proteus  1.7.3.dev0
C/C++/Fortran libraries
superluWrappers.c
Go to the documentation of this file.
1 /* Generated by Cython 0.29.21 */
2 
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
6  #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8  #error Cython requires Python 2.6+ or Python 3.3+.
9 #else
10 #define CYTHON_ABI "0_29_21"
11 #define CYTHON_HEX_VERSION 0x001D15F0
12 #define CYTHON_FUTURE_DIVISION 0
13 #include <stddef.h>
14 #ifndef offsetof
15  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
16 #endif
17 #if !defined(WIN32) && !defined(MS_WINDOWS)
18  #ifndef __stdcall
19  #define __stdcall
20  #endif
21  #ifndef __cdecl
22  #define __cdecl
23  #endif
24  #ifndef __fastcall
25  #define __fastcall
26  #endif
27 #endif
28 #ifndef DL_IMPORT
29  #define DL_IMPORT(t) t
30 #endif
31 #ifndef DL_EXPORT
32  #define DL_EXPORT(t) t
33 #endif
34 #define __PYX_COMMA ,
35 #ifndef HAVE_LONG_LONG
36  #if PY_VERSION_HEX >= 0x02070000
37  #define HAVE_LONG_LONG
38  #endif
39 #endif
40 #ifndef PY_LONG_LONG
41  #define PY_LONG_LONG LONG_LONG
42 #endif
43 #ifndef Py_HUGE_VAL
44  #define Py_HUGE_VAL HUGE_VAL
45 #endif
46 #ifdef PYPY_VERSION
47  #define CYTHON_COMPILING_IN_PYPY 1
48  #define CYTHON_COMPILING_IN_PYSTON 0
49  #define CYTHON_COMPILING_IN_CPYTHON 0
50  #undef CYTHON_USE_TYPE_SLOTS
51  #define CYTHON_USE_TYPE_SLOTS 0
52  #undef CYTHON_USE_PYTYPE_LOOKUP
53  #define CYTHON_USE_PYTYPE_LOOKUP 0
54  #if PY_VERSION_HEX < 0x03050000
55  #undef CYTHON_USE_ASYNC_SLOTS
56  #define CYTHON_USE_ASYNC_SLOTS 0
57  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
58  #define CYTHON_USE_ASYNC_SLOTS 1
59  #endif
60  #undef CYTHON_USE_PYLIST_INTERNALS
61  #define CYTHON_USE_PYLIST_INTERNALS 0
62  #undef CYTHON_USE_UNICODE_INTERNALS
63  #define CYTHON_USE_UNICODE_INTERNALS 0
64  #undef CYTHON_USE_UNICODE_WRITER
65  #define CYTHON_USE_UNICODE_WRITER 0
66  #undef CYTHON_USE_PYLONG_INTERNALS
67  #define CYTHON_USE_PYLONG_INTERNALS 0
68  #undef CYTHON_AVOID_BORROWED_REFS
69  #define CYTHON_AVOID_BORROWED_REFS 1
70  #undef CYTHON_ASSUME_SAFE_MACROS
71  #define CYTHON_ASSUME_SAFE_MACROS 0
72  #undef CYTHON_UNPACK_METHODS
73  #define CYTHON_UNPACK_METHODS 0
74  #undef CYTHON_FAST_THREAD_STATE
75  #define CYTHON_FAST_THREAD_STATE 0
76  #undef CYTHON_FAST_PYCALL
77  #define CYTHON_FAST_PYCALL 0
78  #undef CYTHON_PEP489_MULTI_PHASE_INIT
79  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
80  #undef CYTHON_USE_TP_FINALIZE
81  #define CYTHON_USE_TP_FINALIZE 0
82  #undef CYTHON_USE_DICT_VERSIONS
83  #define CYTHON_USE_DICT_VERSIONS 0
84  #undef CYTHON_USE_EXC_INFO_STACK
85  #define CYTHON_USE_EXC_INFO_STACK 0
86 #elif defined(PYSTON_VERSION)
87  #define CYTHON_COMPILING_IN_PYPY 0
88  #define CYTHON_COMPILING_IN_PYSTON 1
89  #define CYTHON_COMPILING_IN_CPYTHON 0
90  #ifndef CYTHON_USE_TYPE_SLOTS
91  #define CYTHON_USE_TYPE_SLOTS 1
92  #endif
93  #undef CYTHON_USE_PYTYPE_LOOKUP
94  #define CYTHON_USE_PYTYPE_LOOKUP 0
95  #undef CYTHON_USE_ASYNC_SLOTS
96  #define CYTHON_USE_ASYNC_SLOTS 0
97  #undef CYTHON_USE_PYLIST_INTERNALS
98  #define CYTHON_USE_PYLIST_INTERNALS 0
99  #ifndef CYTHON_USE_UNICODE_INTERNALS
100  #define CYTHON_USE_UNICODE_INTERNALS 1
101  #endif
102  #undef CYTHON_USE_UNICODE_WRITER
103  #define CYTHON_USE_UNICODE_WRITER 0
104  #undef CYTHON_USE_PYLONG_INTERNALS
105  #define CYTHON_USE_PYLONG_INTERNALS 0
106  #ifndef CYTHON_AVOID_BORROWED_REFS
107  #define CYTHON_AVOID_BORROWED_REFS 0
108  #endif
109  #ifndef CYTHON_ASSUME_SAFE_MACROS
110  #define CYTHON_ASSUME_SAFE_MACROS 1
111  #endif
112  #ifndef CYTHON_UNPACK_METHODS
113  #define CYTHON_UNPACK_METHODS 1
114  #endif
115  #undef CYTHON_FAST_THREAD_STATE
116  #define CYTHON_FAST_THREAD_STATE 0
117  #undef CYTHON_FAST_PYCALL
118  #define CYTHON_FAST_PYCALL 0
119  #undef CYTHON_PEP489_MULTI_PHASE_INIT
120  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
121  #undef CYTHON_USE_TP_FINALIZE
122  #define CYTHON_USE_TP_FINALIZE 0
123  #undef CYTHON_USE_DICT_VERSIONS
124  #define CYTHON_USE_DICT_VERSIONS 0
125  #undef CYTHON_USE_EXC_INFO_STACK
126  #define CYTHON_USE_EXC_INFO_STACK 0
127 #else
128  #define CYTHON_COMPILING_IN_PYPY 0
129  #define CYTHON_COMPILING_IN_PYSTON 0
130  #define CYTHON_COMPILING_IN_CPYTHON 1
131  #ifndef CYTHON_USE_TYPE_SLOTS
132  #define CYTHON_USE_TYPE_SLOTS 1
133  #endif
134  #if PY_VERSION_HEX < 0x02070000
135  #undef CYTHON_USE_PYTYPE_LOOKUP
136  #define CYTHON_USE_PYTYPE_LOOKUP 0
137  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
138  #define CYTHON_USE_PYTYPE_LOOKUP 1
139  #endif
140  #if PY_MAJOR_VERSION < 3
141  #undef CYTHON_USE_ASYNC_SLOTS
142  #define CYTHON_USE_ASYNC_SLOTS 0
143  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
144  #define CYTHON_USE_ASYNC_SLOTS 1
145  #endif
146  #if PY_VERSION_HEX < 0x02070000
147  #undef CYTHON_USE_PYLONG_INTERNALS
148  #define CYTHON_USE_PYLONG_INTERNALS 0
149  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
150  #define CYTHON_USE_PYLONG_INTERNALS 1
151  #endif
152  #ifndef CYTHON_USE_PYLIST_INTERNALS
153  #define CYTHON_USE_PYLIST_INTERNALS 1
154  #endif
155  #ifndef CYTHON_USE_UNICODE_INTERNALS
156  #define CYTHON_USE_UNICODE_INTERNALS 1
157  #endif
158  #if PY_VERSION_HEX < 0x030300F0
159  #undef CYTHON_USE_UNICODE_WRITER
160  #define CYTHON_USE_UNICODE_WRITER 0
161  #elif !defined(CYTHON_USE_UNICODE_WRITER)
162  #define CYTHON_USE_UNICODE_WRITER 1
163  #endif
164  #ifndef CYTHON_AVOID_BORROWED_REFS
165  #define CYTHON_AVOID_BORROWED_REFS 0
166  #endif
167  #ifndef CYTHON_ASSUME_SAFE_MACROS
168  #define CYTHON_ASSUME_SAFE_MACROS 1
169  #endif
170  #ifndef CYTHON_UNPACK_METHODS
171  #define CYTHON_UNPACK_METHODS 1
172  #endif
173  #ifndef CYTHON_FAST_THREAD_STATE
174  #define CYTHON_FAST_THREAD_STATE 1
175  #endif
176  #ifndef CYTHON_FAST_PYCALL
177  #define CYTHON_FAST_PYCALL 1
178  #endif
179  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
180  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
181  #endif
182  #ifndef CYTHON_USE_TP_FINALIZE
183  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
184  #endif
185  #ifndef CYTHON_USE_DICT_VERSIONS
186  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
187  #endif
188  #ifndef CYTHON_USE_EXC_INFO_STACK
189  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
190  #endif
191 #endif
192 #if !defined(CYTHON_FAST_PYCCALL)
193 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
194 #endif
195 #if CYTHON_USE_PYLONG_INTERNALS
196  #include "longintrepr.h"
197  #undef SHIFT
198  #undef BASE
199  #undef MASK
200  #ifdef SIZEOF_VOID_P
201  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
202  #endif
203 #endif
204 #ifndef __has_attribute
205  #define __has_attribute(x) 0
206 #endif
207 #ifndef __has_cpp_attribute
208  #define __has_cpp_attribute(x) 0
209 #endif
210 #ifndef CYTHON_RESTRICT
211  #if defined(__GNUC__)
212  #define CYTHON_RESTRICT __restrict__
213  #elif defined(_MSC_VER) && _MSC_VER >= 1400
214  #define CYTHON_RESTRICT __restrict
215  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
216  #define CYTHON_RESTRICT restrict
217  #else
218  #define CYTHON_RESTRICT
219  #endif
220 #endif
221 #ifndef CYTHON_UNUSED
222 # if defined(__GNUC__)
223 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
224 # define CYTHON_UNUSED __attribute__ ((__unused__))
225 # else
226 # define CYTHON_UNUSED
227 # endif
228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
229 # define CYTHON_UNUSED __attribute__ ((__unused__))
230 # else
231 # define CYTHON_UNUSED
232 # endif
233 #endif
234 #ifndef CYTHON_MAYBE_UNUSED_VAR
235 # if defined(__cplusplus)
236  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
237 # else
238 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
239 # endif
240 #endif
241 #ifndef CYTHON_NCP_UNUSED
242 # if CYTHON_COMPILING_IN_CPYTHON
243 # define CYTHON_NCP_UNUSED
244 # else
245 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
246 # endif
247 #endif
248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
249 #ifdef _MSC_VER
250  #ifndef _MSC_STDINT_H_
251  #if _MSC_VER < 1300
252  typedef unsigned char uint8_t;
253  typedef unsigned int uint32_t;
254  #else
255  typedef unsigned __int8 uint8_t;
256  typedef unsigned __int32 uint32_t;
257  #endif
258  #endif
259 #else
260  #include <stdint.h>
261 #endif
262 #ifndef CYTHON_FALLTHROUGH
263  #if defined(__cplusplus) && __cplusplus >= 201103L
264  #if __has_cpp_attribute(fallthrough)
265  #define CYTHON_FALLTHROUGH [[fallthrough]]
266  #elif __has_cpp_attribute(clang::fallthrough)
267  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
268  #elif __has_cpp_attribute(gnu::fallthrough)
269  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
270  #endif
271  #endif
272  #ifndef CYTHON_FALLTHROUGH
273  #if __has_attribute(fallthrough)
274  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
275  #else
276  #define CYTHON_FALLTHROUGH
277  #endif
278  #endif
279  #if defined(__clang__ ) && defined(__apple_build_version__)
280  #if __apple_build_version__ < 7000000
281  #undef CYTHON_FALLTHROUGH
282  #define CYTHON_FALLTHROUGH
283  #endif
284  #endif
285 #endif
286 
287 #ifndef CYTHON_INLINE
288  #if defined(__clang__)
289  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
290  #elif defined(__GNUC__)
291  #define CYTHON_INLINE __inline__
292  #elif defined(_MSC_VER)
293  #define CYTHON_INLINE __inline
294  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
295  #define CYTHON_INLINE inline
296  #else
297  #define CYTHON_INLINE
298  #endif
299 #endif
300 
301 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
302  #define Py_OptimizeFlag 0
303 #endif
304 #define __PYX_BUILD_PY_SSIZE_T "n"
305 #define CYTHON_FORMAT_SSIZE_T "z"
306 #if PY_MAJOR_VERSION < 3
307  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
308  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
309  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
310  #define __Pyx_DefaultClassType PyClass_Type
311 #else
312  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
313 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
314  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
315  PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
316 #else
317  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
318  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
319 #endif
320  #define __Pyx_DefaultClassType PyType_Type
321 #endif
322 #ifndef Py_TPFLAGS_CHECKTYPES
323  #define Py_TPFLAGS_CHECKTYPES 0
324 #endif
325 #ifndef Py_TPFLAGS_HAVE_INDEX
326  #define Py_TPFLAGS_HAVE_INDEX 0
327 #endif
328 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
329  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
330 #endif
331 #ifndef Py_TPFLAGS_HAVE_FINALIZE
332  #define Py_TPFLAGS_HAVE_FINALIZE 0
333 #endif
334 #ifndef METH_STACKLESS
335  #define METH_STACKLESS 0
336 #endif
337 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
338  #ifndef METH_FASTCALL
339  #define METH_FASTCALL 0x80
340  #endif
341  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
342  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
343  Py_ssize_t nargs, PyObject *kwnames);
344 #else
345  #define __Pyx_PyCFunctionFast _PyCFunctionFast
346  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
347 #endif
348 #if CYTHON_FAST_PYCCALL
349 #define __Pyx_PyFastCFunction_Check(func)\
350  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
351 #else
352 #define __Pyx_PyFastCFunction_Check(func) 0
353 #endif
354 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
355  #define PyObject_Malloc(s) PyMem_Malloc(s)
356  #define PyObject_Free(p) PyMem_Free(p)
357  #define PyObject_Realloc(p) PyMem_Realloc(p)
358 #endif
359 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
360  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
361  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
362  #define PyMem_RawFree(p) PyMem_Free(p)
363 #endif
364 #if CYTHON_COMPILING_IN_PYSTON
365  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
366  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
367 #else
368  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
369  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
370 #endif
371 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
372  #define __Pyx_PyThreadState_Current PyThreadState_GET()
373 #elif PY_VERSION_HEX >= 0x03060000
374  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
375 #elif PY_VERSION_HEX >= 0x03000000
376  #define __Pyx_PyThreadState_Current PyThreadState_GET()
377 #else
378  #define __Pyx_PyThreadState_Current _PyThreadState_Current
379 #endif
380 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
381 #include "pythread.h"
382 #define Py_tss_NEEDS_INIT 0
383 typedef int Py_tss_t;
384 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
385  *key = PyThread_create_key();
386  return 0;
387 }
388 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
389  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
390  *key = Py_tss_NEEDS_INIT;
391  return key;
392 }
393 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
394  PyObject_Free(key);
395 }
396 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
397  return *key != Py_tss_NEEDS_INIT;
398 }
399 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
400  PyThread_delete_key(*key);
401  *key = Py_tss_NEEDS_INIT;
402 }
403 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
404  return PyThread_set_key_value(*key, value);
405 }
406 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
407  return PyThread_get_key_value(*key);
408 }
409 #endif
410 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
411 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
412 #else
413 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
414 #endif
415 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
416  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
417  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
418 #else
419  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
420  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
421 #endif
422 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
423 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
424 #else
425 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
426 #endif
427 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
428  #define CYTHON_PEP393_ENABLED 1
429  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
430  0 : _PyUnicode_Ready((PyObject *)(op)))
431  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
432  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
433  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
434  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
435  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
436  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
437  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
438  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
439  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
440  #else
441  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
442  #endif
443 #else
444  #define CYTHON_PEP393_ENABLED 0
445  #define PyUnicode_1BYTE_KIND 1
446  #define PyUnicode_2BYTE_KIND 2
447  #define PyUnicode_4BYTE_KIND 4
448  #define __Pyx_PyUnicode_READY(op) (0)
449  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
450  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
451  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
452  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
453  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
454  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
455  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
456  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
457 #endif
458 #if CYTHON_COMPILING_IN_PYPY
459  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
460  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
461 #else
462  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
463  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
464  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
465 #endif
466 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
467  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
468 #endif
469 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
470  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
471 #endif
472 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
473  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
474 #endif
475 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
476 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
477 #if PY_MAJOR_VERSION >= 3
478  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
479 #else
480  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
481 #endif
482 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
483  #define PyObject_ASCII(o) PyObject_Repr(o)
484 #endif
485 #if PY_MAJOR_VERSION >= 3
486  #define PyBaseString_Type PyUnicode_Type
487  #define PyStringObject PyUnicodeObject
488  #define PyString_Type PyUnicode_Type
489  #define PyString_Check PyUnicode_Check
490  #define PyString_CheckExact PyUnicode_CheckExact
491 #ifndef PyObject_Unicode
492  #define PyObject_Unicode PyObject_Str
493 #endif
494 #endif
495 #if PY_MAJOR_VERSION >= 3
496  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
497  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
498 #else
499  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
500  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
501 #endif
502 #ifndef PySet_CheckExact
503  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
504 #endif
505 #if PY_VERSION_HEX >= 0x030900A4
506  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
507  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
508 #else
509  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
510  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
511 #endif
512 #if CYTHON_ASSUME_SAFE_MACROS
513  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
514 #else
515  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
516 #endif
517 #if PY_MAJOR_VERSION >= 3
518  #define PyIntObject PyLongObject
519  #define PyInt_Type PyLong_Type
520  #define PyInt_Check(op) PyLong_Check(op)
521  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
522  #define PyInt_FromString PyLong_FromString
523  #define PyInt_FromUnicode PyLong_FromUnicode
524  #define PyInt_FromLong PyLong_FromLong
525  #define PyInt_FromSize_t PyLong_FromSize_t
526  #define PyInt_FromSsize_t PyLong_FromSsize_t
527  #define PyInt_AsLong PyLong_AsLong
528  #define PyInt_AS_LONG PyLong_AS_LONG
529  #define PyInt_AsSsize_t PyLong_AsSsize_t
530  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
531  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
532  #define PyNumber_Int PyNumber_Long
533 #endif
534 #if PY_MAJOR_VERSION >= 3
535  #define PyBoolObject PyLongObject
536 #endif
537 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
538  #ifndef PyUnicode_InternFromString
539  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
540  #endif
541 #endif
542 #if PY_VERSION_HEX < 0x030200A4
543  typedef long Py_hash_t;
544  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
545  #define __Pyx_PyInt_AsHash_t PyInt_AsLong
546 #else
547  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
548  #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
549 #endif
550 #if PY_MAJOR_VERSION >= 3
551  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
552 #else
553  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
554 #endif
555 #if CYTHON_USE_ASYNC_SLOTS
556  #if PY_VERSION_HEX >= 0x030500B1
557  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
558  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
559  #else
560  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
561  #endif
562 #else
563  #define __Pyx_PyType_AsAsync(obj) NULL
564 #endif
565 #ifndef __Pyx_PyAsyncMethodsStruct
566  typedef struct {
567  unaryfunc am_await;
568  unaryfunc am_aiter;
569  unaryfunc am_anext;
570  } __Pyx_PyAsyncMethodsStruct;
571 #endif
572 
573 #if defined(WIN32) || defined(MS_WINDOWS)
574  #define _USE_MATH_DEFINES
575 #endif
576 #include <math.h>
577 #ifdef NAN
578 #define __PYX_NAN() ((float) NAN)
579 #else
580 static CYTHON_INLINE float __PYX_NAN() {
581  float value;
582  memset(&value, 0xFF, sizeof(value));
583  return value;
584 }
585 #endif
586 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
587 #define __Pyx_truncl trunc
588 #else
589 #define __Pyx_truncl truncl
590 #endif
591 
592 #define __PYX_MARK_ERR_POS(f_index, lineno) \
593  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
594 #define __PYX_ERR(f_index, lineno, Ln_error) \
595  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
596 
597 #ifndef __PYX_EXTERN_C
598  #ifdef __cplusplus
599  #define __PYX_EXTERN_C extern "C"
600  #else
601  #define __PYX_EXTERN_C extern
602  #endif
603 #endif
604 
605 #define __PYX_HAVE__superluWrappers
606 #define __PYX_HAVE_API__superluWrappers
607 /* Early includes */
608 #include <string.h>
609 #include <stdio.h>
610 #include "numpy/arrayobject.h"
611 #include "numpy/ufuncobject.h"
612 
613  /* NumPy API declarations from "numpy/__init__.pxd" */
614 
615 #include "proteus_superlu.h"
616 #include <stdlib.h>
617 #include "pythread.h"
618 #include "pystate.h"
619 #ifdef _OPENMP
620 #include <omp.h>
621 #endif /* _OPENMP */
622 
623 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
624 #define CYTHON_WITHOUT_ASSERTIONS
625 #endif
626 
627 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
628  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
629 
630 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
631 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
632 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
633 #define __PYX_DEFAULT_STRING_ENCODING ""
634 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
635 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
636 #define __Pyx_uchar_cast(c) ((unsigned char)c)
637 #define __Pyx_long_cast(x) ((long)x)
638 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
639  (sizeof(type) < sizeof(Py_ssize_t)) ||\
640  (sizeof(type) > sizeof(Py_ssize_t) &&\
641  likely(v < (type)PY_SSIZE_T_MAX ||\
642  v == (type)PY_SSIZE_T_MAX) &&\
643  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
644  v == (type)PY_SSIZE_T_MIN))) ||\
645  (sizeof(type) == sizeof(Py_ssize_t) &&\
646  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
647  v == (type)PY_SSIZE_T_MAX))) )
648 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
649  return (size_t) i < (size_t) limit;
650 }
651 #if defined (__cplusplus) && __cplusplus >= 201103L
652  #include <cstdlib>
653  #define __Pyx_sst_abs(value) std::abs(value)
654 #elif SIZEOF_INT >= SIZEOF_SIZE_T
655  #define __Pyx_sst_abs(value) abs(value)
656 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
657  #define __Pyx_sst_abs(value) labs(value)
658 #elif defined (_MSC_VER)
659  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
660 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
661  #define __Pyx_sst_abs(value) llabs(value)
662 #elif defined (__GNUC__)
663  #define __Pyx_sst_abs(value) __builtin_llabs(value)
664 #else
665  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
666 #endif
667 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
668 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
669 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
670 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
671 #define __Pyx_PyBytes_FromString PyBytes_FromString
672 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
673 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
674 #if PY_MAJOR_VERSION < 3
675  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
676  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
677 #else
678  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
679  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
680 #endif
681 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
682 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
683 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
684 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
685 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
686 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
687 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
688 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
689 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
690 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
691 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
692 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
693 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
694 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
695 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
696 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
697 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
698  const Py_UNICODE *u_end = u;
699  while (*u_end++) ;
700  return (size_t)(u_end - u - 1);
701 }
702 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
703 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
704 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
705 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
706 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
707 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
708 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
709 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
710 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
711 #define __Pyx_PySequence_Tuple(obj)\
712  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
713 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
714 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
715 #if CYTHON_ASSUME_SAFE_MACROS
716 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
717 #else
718 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
719 #endif
720 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
721 #if PY_MAJOR_VERSION >= 3
722 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
723 #else
724 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
725 #endif
726 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
727 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
728 static int __Pyx_sys_getdefaultencoding_not_ascii;
729 static int __Pyx_init_sys_getdefaultencoding_params(void) {
730  PyObject* sys;
731  PyObject* default_encoding = NULL;
732  PyObject* ascii_chars_u = NULL;
733  PyObject* ascii_chars_b = NULL;
734  const char* default_encoding_c;
735  sys = PyImport_ImportModule("sys");
736  if (!sys) goto bad;
737  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
738  Py_DECREF(sys);
739  if (!default_encoding) goto bad;
740  default_encoding_c = PyBytes_AsString(default_encoding);
741  if (!default_encoding_c) goto bad;
742  if (strcmp(default_encoding_c, "ascii") == 0) {
743  __Pyx_sys_getdefaultencoding_not_ascii = 0;
744  } else {
745  char ascii_chars[128];
746  int c;
747  for (c = 0; c < 128; c++) {
748  ascii_chars[c] = c;
749  }
750  __Pyx_sys_getdefaultencoding_not_ascii = 1;
751  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
752  if (!ascii_chars_u) goto bad;
753  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
754  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
755  PyErr_Format(
756  PyExc_ValueError,
757  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
758  default_encoding_c);
759  goto bad;
760  }
761  Py_DECREF(ascii_chars_u);
762  Py_DECREF(ascii_chars_b);
763  }
764  Py_DECREF(default_encoding);
765  return 0;
766 bad:
767  Py_XDECREF(default_encoding);
768  Py_XDECREF(ascii_chars_u);
769  Py_XDECREF(ascii_chars_b);
770  return -1;
771 }
772 #endif
773 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
774 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
775 #else
776 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
777 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
778 static char* __PYX_DEFAULT_STRING_ENCODING;
779 static int __Pyx_init_sys_getdefaultencoding_params(void) {
780  PyObject* sys;
781  PyObject* default_encoding = NULL;
782  char* default_encoding_c;
783  sys = PyImport_ImportModule("sys");
784  if (!sys) goto bad;
785  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
786  Py_DECREF(sys);
787  if (!default_encoding) goto bad;
788  default_encoding_c = PyBytes_AsString(default_encoding);
789  if (!default_encoding_c) goto bad;
790  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
791  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
792  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
793  Py_DECREF(default_encoding);
794  return 0;
795 bad:
796  Py_XDECREF(default_encoding);
797  return -1;
798 }
799 #endif
800 #endif
801 
802 
803 /* Test for GCC > 2.95 */
804 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
805  #define likely(x) __builtin_expect(!!(x), 1)
806  #define unlikely(x) __builtin_expect(!!(x), 0)
807 #else /* !__GNUC__ or GCC < 2.95 */
808  #define likely(x) (x)
809  #define unlikely(x) (x)
810 #endif /* __GNUC__ */
811 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
812 
813 static PyObject *__pyx_m = NULL;
814 static PyObject *__pyx_d;
815 static PyObject *__pyx_b;
816 static PyObject *__pyx_cython_runtime = NULL;
817 static PyObject *__pyx_empty_tuple;
818 static PyObject *__pyx_empty_bytes;
819 static PyObject *__pyx_empty_unicode;
820 static int __pyx_lineno;
821 static int __pyx_clineno = 0;
822 static const char * __pyx_cfilenm= __FILE__;
823 static const char *__pyx_filename;
824 
825 /* Header.proto */
826 #if !defined(CYTHON_CCOMPLEX)
827  #if defined(__cplusplus)
828  #define CYTHON_CCOMPLEX 1
829  #elif defined(_Complex_I)
830  #define CYTHON_CCOMPLEX 1
831  #else
832  #define CYTHON_CCOMPLEX 0
833  #endif
834 #endif
835 #if CYTHON_CCOMPLEX
836  #ifdef __cplusplus
837  #include <complex>
838  #else
839  #include <complex.h>
840  #endif
841 #endif
842 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
843  #undef _Complex_I
844  #define _Complex_I 1.0fj
845 #endif
846 
847 
848 static const char *__pyx_f[] = {
849  "proteus/superluWrappers.pyx",
850  "stringsource",
851  "__init__.pxd",
852  "type.pxd",
853 };
854 /* MemviewSliceStruct.proto */
855 struct __pyx_memoryview_obj;
856 typedef struct {
857  struct __pyx_memoryview_obj *memview;
858  char *data;
859  Py_ssize_t shape[8];
860  Py_ssize_t strides[8];
861  Py_ssize_t suboffsets[8];
862 } __Pyx_memviewslice;
863 #define __Pyx_MemoryView_Len(m) (m.shape[0])
864 
865 /* Atomics.proto */
866 #include <pythread.h>
867 #ifndef CYTHON_ATOMICS
868  #define CYTHON_ATOMICS 1
869 #endif
870 #define __pyx_atomic_int_type int
871 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
872  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
873  !defined(__i386__)
874  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
875  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
876  #ifdef __PYX_DEBUG_ATOMICS
877  #warning "Using GNU atomics"
878  #endif
879 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
880  #include <Windows.h>
881  #undef __pyx_atomic_int_type
882  #define __pyx_atomic_int_type LONG
883  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
884  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
885  #ifdef __PYX_DEBUG_ATOMICS
886  #pragma message ("Using MSVC atomics")
887  #endif
888 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
889  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
890  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
891  #ifdef __PYX_DEBUG_ATOMICS
892  #warning "Using Intel atomics"
893  #endif
894 #else
895  #undef CYTHON_ATOMICS
896  #define CYTHON_ATOMICS 0
897  #ifdef __PYX_DEBUG_ATOMICS
898  #warning "Not using atomics"
899  #endif
900 #endif
901 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
902 #if CYTHON_ATOMICS
903  #define __pyx_add_acquisition_count(memview)\
904  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
905  #define __pyx_sub_acquisition_count(memview)\
906  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
907 #else
908  #define __pyx_add_acquisition_count(memview)\
909  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
910  #define __pyx_sub_acquisition_count(memview)\
911  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
912 #endif
913 
914 /* ForceInitThreads.proto */
915 #ifndef __PYX_FORCE_INIT_THREADS
916  #define __PYX_FORCE_INIT_THREADS 0
917 #endif
918 
919 /* NoFastGil.proto */
920 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
921 #define __Pyx_PyGILState_Release PyGILState_Release
922 #define __Pyx_FastGIL_Remember()
923 #define __Pyx_FastGIL_Forget()
924 #define __Pyx_FastGilFuncInit()
925 
926 /* BufferFormatStructs.proto */
927 #define IS_UNSIGNED(type) (((type) -1) > 0)
928 struct __Pyx_StructField_;
929 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
930 typedef struct {
931  const char* name;
932  struct __Pyx_StructField_* fields;
933  size_t size;
934  size_t arraysize[8];
935  int ndim;
936  char typegroup;
937  char is_unsigned;
938  int flags;
939 } __Pyx_TypeInfo;
940 typedef struct __Pyx_StructField_ {
941  __Pyx_TypeInfo* type;
942  const char* name;
943  size_t offset;
944 } __Pyx_StructField;
945 typedef struct {
946  __Pyx_StructField* field;
947  size_t parent_offset;
948 } __Pyx_BufFmt_StackElem;
949 typedef struct {
950  __Pyx_StructField root;
951  __Pyx_BufFmt_StackElem* head;
952  size_t fmt_offset;
953  size_t new_count, enc_count;
954  size_t struct_alignment;
955  int is_complex;
956  char enc_type;
957  char new_packmode;
958  char enc_packmode;
959  char is_valid_array;
960 } __Pyx_BufFmt_Context;
961 
962 
963 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":697
964  * # in Cython to enable them only on the right systems.
965  *
966  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
967  * ctypedef npy_int16 int16_t
968  * ctypedef npy_int32 int32_t
969  */
970 typedef npy_int8 __pyx_t_5numpy_int8_t;
971 
972 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":698
973  *
974  * ctypedef npy_int8 int8_t
975  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
976  * ctypedef npy_int32 int32_t
977  * ctypedef npy_int64 int64_t
978  */
979 typedef npy_int16 __pyx_t_5numpy_int16_t;
980 
981 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":699
982  * ctypedef npy_int8 int8_t
983  * ctypedef npy_int16 int16_t
984  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
985  * ctypedef npy_int64 int64_t
986  * #ctypedef npy_int96 int96_t
987  */
988 typedef npy_int32 __pyx_t_5numpy_int32_t;
989 
990 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":700
991  * ctypedef npy_int16 int16_t
992  * ctypedef npy_int32 int32_t
993  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
994  * #ctypedef npy_int96 int96_t
995  * #ctypedef npy_int128 int128_t
996  */
997 typedef npy_int64 __pyx_t_5numpy_int64_t;
998 
999 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":704
1000  * #ctypedef npy_int128 int128_t
1001  *
1002  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1003  * ctypedef npy_uint16 uint16_t
1004  * ctypedef npy_uint32 uint32_t
1005  */
1006 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1007 
1008 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":705
1009  *
1010  * ctypedef npy_uint8 uint8_t
1011  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1012  * ctypedef npy_uint32 uint32_t
1013  * ctypedef npy_uint64 uint64_t
1014  */
1015 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1016 
1017 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":706
1018  * ctypedef npy_uint8 uint8_t
1019  * ctypedef npy_uint16 uint16_t
1020  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1021  * ctypedef npy_uint64 uint64_t
1022  * #ctypedef npy_uint96 uint96_t
1023  */
1024 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1025 
1026 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":707
1027  * ctypedef npy_uint16 uint16_t
1028  * ctypedef npy_uint32 uint32_t
1029  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1030  * #ctypedef npy_uint96 uint96_t
1031  * #ctypedef npy_uint128 uint128_t
1032  */
1033 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1034 
1035 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":711
1036  * #ctypedef npy_uint128 uint128_t
1037  *
1038  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1039  * ctypedef npy_float64 float64_t
1040  * #ctypedef npy_float80 float80_t
1041  */
1042 typedef npy_float32 __pyx_t_5numpy_float32_t;
1043 
1044 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":712
1045  *
1046  * ctypedef npy_float32 float32_t
1047  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1048  * #ctypedef npy_float80 float80_t
1049  * #ctypedef npy_float128 float128_t
1050  */
1051 typedef npy_float64 __pyx_t_5numpy_float64_t;
1052 
1053 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":721
1054  * # The int types are mapped a bit surprising --
1055  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1056  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1057  * ctypedef npy_longlong long_t
1058  * ctypedef npy_longlong longlong_t
1059  */
1060 typedef npy_long __pyx_t_5numpy_int_t;
1061 
1062 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":722
1063  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1064  * ctypedef npy_long int_t
1065  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1066  * ctypedef npy_longlong longlong_t
1067  *
1068  */
1069 typedef npy_longlong __pyx_t_5numpy_long_t;
1070 
1071 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":723
1072  * ctypedef npy_long int_t
1073  * ctypedef npy_longlong long_t
1074  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1075  *
1076  * ctypedef npy_ulong uint_t
1077  */
1078 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1079 
1080 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":725
1081  * ctypedef npy_longlong longlong_t
1082  *
1083  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1084  * ctypedef npy_ulonglong ulong_t
1085  * ctypedef npy_ulonglong ulonglong_t
1086  */
1087 typedef npy_ulong __pyx_t_5numpy_uint_t;
1088 
1089 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":726
1090  *
1091  * ctypedef npy_ulong uint_t
1092  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1093  * ctypedef npy_ulonglong ulonglong_t
1094  *
1095  */
1096 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1097 
1098 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":727
1099  * ctypedef npy_ulong uint_t
1100  * ctypedef npy_ulonglong ulong_t
1101  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1102  *
1103  * ctypedef npy_intp intp_t
1104  */
1105 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1106 
1107 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":729
1108  * ctypedef npy_ulonglong ulonglong_t
1109  *
1110  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1111  * ctypedef npy_uintp uintp_t
1112  *
1113  */
1114 typedef npy_intp __pyx_t_5numpy_intp_t;
1115 
1116 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":730
1117  *
1118  * ctypedef npy_intp intp_t
1119  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1120  *
1121  * ctypedef npy_double float_t
1122  */
1123 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1124 
1125 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":732
1126  * ctypedef npy_uintp uintp_t
1127  *
1128  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1129  * ctypedef npy_double double_t
1130  * ctypedef npy_longdouble longdouble_t
1131  */
1132 typedef npy_double __pyx_t_5numpy_float_t;
1133 
1134 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":733
1135  *
1136  * ctypedef npy_double float_t
1137  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1138  * ctypedef npy_longdouble longdouble_t
1139  *
1140  */
1141 typedef npy_double __pyx_t_5numpy_double_t;
1142 
1143 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":734
1144  * ctypedef npy_double float_t
1145  * ctypedef npy_double double_t
1146  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1147  *
1148  * ctypedef npy_cfloat cfloat_t
1149  */
1150 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1151 /* Declarations.proto */
1152 #if CYTHON_CCOMPLEX
1153  #ifdef __cplusplus
1154  typedef ::std::complex< float > __pyx_t_float_complex;
1155  #else
1156  typedef float _Complex __pyx_t_float_complex;
1157  #endif
1158 #else
1159  typedef struct { float real, imag; } __pyx_t_float_complex;
1160 #endif
1161 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1162 
1163 /* Declarations.proto */
1164 #if CYTHON_CCOMPLEX
1165  #ifdef __cplusplus
1166  typedef ::std::complex< double > __pyx_t_double_complex;
1167  #else
1168  typedef double _Complex __pyx_t_double_complex;
1169  #endif
1170 #else
1171  typedef struct { double real, imag; } __pyx_t_double_complex;
1172 #endif
1173 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1174 
1175 
1176 /*--- Type declarations ---*/
1177 struct __pyx_obj_15superluWrappers_cSparseMatrix;
1178 struct __pyx_obj_15superluWrappers_SparseFactor;
1179 struct __pyx_array_obj;
1180 struct __pyx_MemviewEnum_obj;
1181 struct __pyx_memoryview_obj;
1182 struct __pyx_memoryviewslice_obj;
1183 
1184 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":736
1185  * ctypedef npy_longdouble longdouble_t
1186  *
1187  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1188  * ctypedef npy_cdouble cdouble_t
1189  * ctypedef npy_clongdouble clongdouble_t
1190  */
1191 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1192 
1193 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":737
1194  *
1195  * ctypedef npy_cfloat cfloat_t
1196  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1197  * ctypedef npy_clongdouble clongdouble_t
1198  *
1199  */
1200 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1201 
1202 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":738
1203  * ctypedef npy_cfloat cfloat_t
1204  * ctypedef npy_cdouble cdouble_t
1205  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1206  *
1207  * ctypedef npy_cdouble complex_t
1208  */
1209 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1210 
1211 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":740
1212  * ctypedef npy_clongdouble clongdouble_t
1213  *
1214  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1215  *
1216  * cdef inline object PyArray_MultiIterNew1(a):
1217  */
1218 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1219 struct __pyx_t_15superluWrappers__NRformat;
1220 struct __pyx_t_15superluWrappers__NCformat;
1221 struct __pyx_t_15superluWrappers__DNformat;
1222 struct __pyx_t_15superluWrappers__NCPformat;
1223 
1224 /* "superluWrappers.pxd":61
1225  * void csp_preorder "sp_preorder"(_superlu_options_t *, _SuperMatrix *, int *, int *, _SuperMatrix *)
1226  *
1227  * cdef struct _NRformat: # <<<<<<<<<<<<<<
1228  * np.int32_t nnz
1229  * np.float64_t * nzval
1230  */
1231 struct __pyx_t_15superluWrappers__NRformat {
1232  __pyx_t_5numpy_int32_t nnz;
1233  __pyx_t_5numpy_float64_t *nzval;
1234  __pyx_t_5numpy_int32_t *colind;
1235  __pyx_t_5numpy_int32_t *rowptr;
1236 };
1237 
1238 /* "superluWrappers.pyx":128
1239  * yp[i] = tmp
1240  *
1241  * cdef struct _NCformat: # <<<<<<<<<<<<<<
1242  * np.int32_t nnz
1243  * np.float64_t * nzval
1244  */
1245 struct __pyx_t_15superluWrappers__NCformat {
1246  __pyx_t_5numpy_int32_t nnz;
1247  __pyx_t_5numpy_float64_t *nzval;
1248  __pyx_t_5numpy_int32_t *rowind;
1249  __pyx_t_5numpy_int32_t *colptr;
1250 };
1251 
1252 /* "superluWrappers.pyx":134
1253  * np.int32_t * colptr
1254  *
1255  * cdef struct _DNformat: # <<<<<<<<<<<<<<
1256  * np.int32_t lda
1257  * void *nzval
1258  */
1259 struct __pyx_t_15superluWrappers__DNformat {
1260  __pyx_t_5numpy_int32_t lda;
1261  void *nzval;
1262 };
1263 
1264 /* "superluWrappers.pyx":138
1265  * void *nzval
1266  *
1267  * cdef struct _NCPformat: # <<<<<<<<<<<<<<
1268  * np.int32_t nnz
1269  * void * nzval
1270  */
1271 struct __pyx_t_15superluWrappers__NCPformat {
1272  __pyx_t_5numpy_int32_t nnz;
1273  void *nzval;
1274  __pyx_t_5numpy_int32_t *rowind;
1275  __pyx_t_5numpy_int32_t *colbeg;
1276  __pyx_t_5numpy_int32_t *colend;
1277 };
1278 
1279 /* "superluWrappers.pxd":67
1280  * np.int32_t * rowptr
1281  *
1282  * cdef class cSparseMatrix(object): # <<<<<<<<<<<<<<
1283  * cdef np.int32_t dim[2]
1284  * cdef _NRformat A
1285  */
1286 struct __pyx_obj_15superluWrappers_cSparseMatrix {
1287  PyObject_HEAD
1288  __pyx_t_5numpy_int32_t dim[2];
1289  struct __pyx_t_15superluWrappers__NRformat A;
1290 };
1291 
1292 
1293 /* "superluWrappers.pyx":145
1294  * np.int32_t * colend
1295  *
1296  * cdef class SparseFactor(object): # <<<<<<<<<<<<<<
1297  *
1298  * cdef _superlu_options_t options
1299  */
1300 struct __pyx_obj_15superluWrappers_SparseFactor {
1301  PyObject_HEAD
1302  struct __pyx_vtabstruct_15superluWrappers_SparseFactor *__pyx_vtab;
1303  superlu_options_t options;
1304  SuperMatrix A;
1305  SuperMatrix AC;
1306  SuperMatrix L;
1307  SuperMatrix U;
1308  SuperMatrix X;
1309  GlobalLU_t Glu;
1310  SuperLUStat_t stat;
1311  struct __pyx_t_15superluWrappers__NCformat storeA;
1312  struct __pyx_t_15superluWrappers__DNformat storeX;
1313  int *perm_c;
1314  int *perm_r;
1315  int *etree;
1316  unsigned int use_same_perm_c;
1317  unsigned int use_same_sparsity;
1318  int dim;
1319 };
1320 
1321 
1322 /* "View.MemoryView":105
1323  *
1324  * @cname("__pyx_array")
1325  * cdef class array: # <<<<<<<<<<<<<<
1326  *
1327  * cdef:
1328  */
1329 struct __pyx_array_obj {
1330  PyObject_HEAD
1331  struct __pyx_vtabstruct_array *__pyx_vtab;
1332  char *data;
1333  Py_ssize_t len;
1334  char *format;
1335  int ndim;
1336  Py_ssize_t *_shape;
1337  Py_ssize_t *_strides;
1338  Py_ssize_t itemsize;
1339  PyObject *mode;
1340  PyObject *_format;
1341  void (*callback_free_data)(void *);
1342  int free_data;
1343  int dtype_is_object;
1344 };
1345 
1346 
1347 /* "View.MemoryView":279
1348  *
1349  * @cname('__pyx_MemviewEnum')
1350  * cdef class Enum(object): # <<<<<<<<<<<<<<
1351  * cdef object name
1352  * def __init__(self, name):
1353  */
1354 struct __pyx_MemviewEnum_obj {
1355  PyObject_HEAD
1356  PyObject *name;
1357 };
1358 
1359 
1360 /* "View.MemoryView":330
1361  *
1362  * @cname('__pyx_memoryview')
1363  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1364  *
1365  * cdef object obj
1366  */
1367 struct __pyx_memoryview_obj {
1368  PyObject_HEAD
1369  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1370  PyObject *obj;
1371  PyObject *_size;
1372  PyObject *_array_interface;
1373  PyThread_type_lock lock;
1374  __pyx_atomic_int acquisition_count[2];
1375  __pyx_atomic_int *acquisition_count_aligned_p;
1376  Py_buffer view;
1377  int flags;
1378  int dtype_is_object;
1379  __Pyx_TypeInfo *typeinfo;
1380 };
1381 
1382 
1383 /* "View.MemoryView":965
1384  *
1385  * @cname('__pyx_memoryviewslice')
1386  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1387  * "Internal class for passing memoryview slices to Python"
1388  *
1389  */
1390 struct __pyx_memoryviewslice_obj {
1391  struct __pyx_memoryview_obj __pyx_base;
1392  __Pyx_memviewslice from_slice;
1393  PyObject *from_object;
1394  PyObject *(*to_object_func)(char *);
1395  int (*to_dtype_func)(char *, PyObject *);
1396 };
1397 
1398 
1399 
1400 /* "superluWrappers.pyx":145
1401  * np.int32_t * colend
1402  *
1403  * cdef class SparseFactor(object): # <<<<<<<<<<<<<<
1404  *
1405  * cdef _superlu_options_t options
1406  */
1407 
1408 struct __pyx_vtabstruct_15superluWrappers_SparseFactor {
1409  PyObject *(*_set_mat_types)(struct __pyx_obj_15superluWrappers_SparseFactor *);
1410 };
1411 static struct __pyx_vtabstruct_15superluWrappers_SparseFactor *__pyx_vtabptr_15superluWrappers_SparseFactor;
1412 
1413 
1414 /* "View.MemoryView":105
1415  *
1416  * @cname("__pyx_array")
1417  * cdef class array: # <<<<<<<<<<<<<<
1418  *
1419  * cdef:
1420  */
1421 
1422 struct __pyx_vtabstruct_array {
1423  PyObject *(*get_memview)(struct __pyx_array_obj *);
1424 };
1425 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1426 
1427 
1428 /* "View.MemoryView":330
1429  *
1430  * @cname('__pyx_memoryview')
1431  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1432  *
1433  * cdef object obj
1434  */
1435 
1436 struct __pyx_vtabstruct_memoryview {
1437  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1438  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1439  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1440  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1441  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1442  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1443  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1444 };
1445 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1446 
1447 
1448 /* "View.MemoryView":965
1449  *
1450  * @cname('__pyx_memoryviewslice')
1451  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1452  * "Internal class for passing memoryview slices to Python"
1453  *
1454  */
1455 
1456 struct __pyx_vtabstruct__memoryviewslice {
1457  struct __pyx_vtabstruct_memoryview __pyx_base;
1458 };
1459 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1460 
1461 /* --- Runtime support code (head) --- */
1462 /* Refnanny.proto */
1463 #ifndef CYTHON_REFNANNY
1464  #define CYTHON_REFNANNY 0
1465 #endif
1466 #if CYTHON_REFNANNY
1467  typedef struct {
1468  void (*INCREF)(void*, PyObject*, int);
1469  void (*DECREF)(void*, PyObject*, int);
1470  void (*GOTREF)(void*, PyObject*, int);
1471  void (*GIVEREF)(void*, PyObject*, int);
1472  void* (*SetupContext)(const char*, int, const char*);
1473  void (*FinishContext)(void**);
1474  } __Pyx_RefNannyAPIStruct;
1475  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1476  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1477  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1478 #ifdef WITH_THREAD
1479  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1480  if (acquire_gil) {\
1481  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1482  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1483  PyGILState_Release(__pyx_gilstate_save);\
1484  } else {\
1485  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1486  }
1487 #else
1488  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1489  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1490 #endif
1491  #define __Pyx_RefNannyFinishContext()\
1492  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1493  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1494  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1495  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1496  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1497  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1498  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1499  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1500  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1501 #else
1502  #define __Pyx_RefNannyDeclarations
1503  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1504  #define __Pyx_RefNannyFinishContext()
1505  #define __Pyx_INCREF(r) Py_INCREF(r)
1506  #define __Pyx_DECREF(r) Py_DECREF(r)
1507  #define __Pyx_GOTREF(r)
1508  #define __Pyx_GIVEREF(r)
1509  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1510  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1511  #define __Pyx_XGOTREF(r)
1512  #define __Pyx_XGIVEREF(r)
1513 #endif
1514 #define __Pyx_XDECREF_SET(r, v) do {\
1515  PyObject *tmp = (PyObject *) r;\
1516  r = v; __Pyx_XDECREF(tmp);\
1517  } while (0)
1518 #define __Pyx_DECREF_SET(r, v) do {\
1519  PyObject *tmp = (PyObject *) r;\
1520  r = v; __Pyx_DECREF(tmp);\
1521  } while (0)
1522 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1523 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1524 
1525 /* PyObjectGetAttrStr.proto */
1526 #if CYTHON_USE_TYPE_SLOTS
1527 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1528 #else
1529 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1530 #endif
1531 
1532 /* GetBuiltinName.proto */
1533 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1534 
1535 /* RaiseArgTupleInvalid.proto */
1536 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1537  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1538 
1539 /* RaiseDoubleKeywords.proto */
1540 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1541 
1542 /* ParseKeywords.proto */
1543 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1544  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1545  const char* function_name);
1546 
1547 /* PyObjectSetAttrStr.proto */
1548 #if CYTHON_USE_TYPE_SLOTS
1549 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1550 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1551 #else
1552 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1553 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1554 #endif
1555 
1556 /* PyObjectCall.proto */
1557 #if CYTHON_COMPILING_IN_CPYTHON
1558 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1559 #else
1560 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1561 #endif
1562 
1563 /* ExtTypeTest.proto */
1564 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1565 
1566 /* MemviewSliceInit.proto */
1567 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1568 #define __Pyx_MEMVIEW_DIRECT 1
1569 #define __Pyx_MEMVIEW_PTR 2
1570 #define __Pyx_MEMVIEW_FULL 4
1571 #define __Pyx_MEMVIEW_CONTIG 8
1572 #define __Pyx_MEMVIEW_STRIDED 16
1573 #define __Pyx_MEMVIEW_FOLLOW 32
1574 #define __Pyx_IS_C_CONTIG 1
1575 #define __Pyx_IS_F_CONTIG 2
1576 static int __Pyx_init_memviewslice(
1577  struct __pyx_memoryview_obj *memview,
1578  int ndim,
1579  __Pyx_memviewslice *memviewslice,
1580  int memview_is_new_reference);
1581 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1582  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1583 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1584  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1585 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1586 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1587 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1588 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1589 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1590 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1591 
1592 /* PyObjectLookupSpecial.proto */
1593 #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
1594 static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
1595  PyObject *res;
1596  PyTypeObject *tp = Py_TYPE(obj);
1597 #if PY_MAJOR_VERSION < 3
1598  if (unlikely(PyInstance_Check(obj)))
1599  return __Pyx_PyObject_GetAttrStr(obj, attr_name);
1600 #endif
1601  res = _PyType_Lookup(tp, attr_name);
1602  if (likely(res)) {
1603  descrgetfunc f = Py_TYPE(res)->tp_descr_get;
1604  if (!f) {
1605  Py_INCREF(res);
1606  } else {
1607  res = f(res, obj, (PyObject *)tp);
1608  }
1609  } else {
1610  PyErr_SetObject(PyExc_AttributeError, attr_name);
1611  }
1612  return res;
1613 }
1614 #else
1615 #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
1616 #endif
1617 
1618 /* PyFunctionFastCall.proto */
1619 #if CYTHON_FAST_PYCALL
1620 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1621  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1622 #if 1 || PY_VERSION_HEX < 0x030600B1
1623 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1624 #else
1625 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1626 #endif
1627 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1628  (sizeof(char [1 - 2*!(cond)]) - 1)
1629 #ifndef Py_MEMBER_SIZE
1630 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1631 #endif
1632  static size_t __pyx_pyframe_localsplus_offset = 0;
1633  #include "frameobject.h"
1634  #define __Pxy_PyFrame_Initialize_Offsets()\
1635  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1636  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1637  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1638  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1639 #endif
1640 
1641 /* PyObjectCallMethO.proto */
1642 #if CYTHON_COMPILING_IN_CPYTHON
1643 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1644 #endif
1645 
1646 /* PyObjectCallNoArg.proto */
1647 #if CYTHON_COMPILING_IN_CPYTHON
1648 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1649 #else
1650 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1651 #endif
1652 
1653 /* PyCFunctionFastCall.proto */
1654 #if CYTHON_FAST_PYCCALL
1655 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1656 #else
1657 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1658 #endif
1659 
1660 /* PyObjectCallOneArg.proto */
1661 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1662 
1663 /* GetItemInt.proto */
1664 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1665  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1666  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1667  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1668  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1669 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1670  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1671  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1672  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1673 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1674  int wraparound, int boundscheck);
1675 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1676  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1677  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1678  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1679 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1680  int wraparound, int boundscheck);
1681 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1682 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1683  int is_list, int wraparound, int boundscheck);
1684 
1685 /* ObjectGetItem.proto */
1686 #if CYTHON_USE_TYPE_SLOTS
1687 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1688 #else
1689 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1690 #endif
1691 
1692 /* PyObjectCall2Args.proto */
1693 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1694 
1695 /* PyIntBinop.proto */
1696 #if !CYTHON_COMPILING_IN_PYPY
1697 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1698 #else
1699 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1700  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1701 #endif
1702 
1703 /* GetTopmostException.proto */
1704 #if CYTHON_USE_EXC_INFO_STACK
1705 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1706 #endif
1707 
1708 /* PyThreadStateGet.proto */
1709 #if CYTHON_FAST_THREAD_STATE
1710 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1711 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1712 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1713 #else
1714 #define __Pyx_PyThreadState_declare
1715 #define __Pyx_PyThreadState_assign
1716 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1717 #endif
1718 
1719 /* SaveResetException.proto */
1720 #if CYTHON_FAST_THREAD_STATE
1721 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1722 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1723 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1724 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1725 #else
1726 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1727 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1728 #endif
1729 
1730 /* GetException.proto */
1731 #if CYTHON_FAST_THREAD_STATE
1732 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1733 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1734 #else
1735 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1736 #endif
1737 
1738 /* PyErrFetchRestore.proto */
1739 #if CYTHON_FAST_THREAD_STATE
1740 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1741 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1742 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1743 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1744 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1745 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1746 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1747 #if CYTHON_COMPILING_IN_CPYTHON
1748 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1749 #else
1750 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1751 #endif
1752 #else
1753 #define __Pyx_PyErr_Clear() PyErr_Clear()
1754 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1755 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1756 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1757 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1758 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1759 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1760 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1761 #endif
1762 
1763 /* SliceObject.proto */
1764 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
1765  PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
1766  PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1767  int has_cstart, int has_cstop, int wraparound);
1768 
1769 /* RaiseException.proto */
1770 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1771 
1772 /* WriteUnraisableException.proto */
1773 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1774  int lineno, const char *filename,
1775  int full_traceback, int nogil);
1776 
1777 /* DictGetItem.proto */
1778 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1779 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1780 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1781  (likely(PyDict_CheckExact(obj)) ?\
1782  __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1783 #else
1784 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1785 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1786 #endif
1787 
1788 /* RaiseTooManyValuesToUnpack.proto */
1789 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1790 
1791 /* RaiseNeedMoreValuesToUnpack.proto */
1792 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1793 
1794 /* RaiseNoneIterError.proto */
1795 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1796 
1797 /* PyErrExceptionMatches.proto */
1798 #if CYTHON_FAST_THREAD_STATE
1799 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1800 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1801 #else
1802 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1803 #endif
1804 
1805 /* ArgTypeTest.proto */
1806 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1807  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1808  __Pyx__ArgTypeTest(obj, type, name, exact))
1809 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1810 
1811 /* IncludeStringH.proto */
1812 #include <string.h>
1813 
1814 /* BytesEquals.proto */
1815 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1816 
1817 /* UnicodeEquals.proto */
1818 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1819 
1820 /* StrEquals.proto */
1821 #if PY_MAJOR_VERSION >= 3
1822 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1823 #else
1824 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1825 #endif
1826 
1827 /* None.proto */
1828 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1829 
1830 /* UnaryNegOverflows.proto */
1831 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1832  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1833 
1834 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1835 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
1836 /* GetAttr.proto */
1837 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1838 
1839 /* decode_c_string_utf16.proto */
1840 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1841  int byteorder = 0;
1842  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1843 }
1844 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1845  int byteorder = -1;
1846  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1847 }
1848 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1849  int byteorder = 1;
1850  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1851 }
1852 
1853 /* decode_c_string.proto */
1854 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1855  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1856  const char* encoding, const char* errors,
1857  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1858 
1859 /* GetAttr3.proto */
1860 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1861 
1862 /* PyDictVersioning.proto */
1863 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1864 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1865 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1866 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1867  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1868  (cache_var) = (value);
1869 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1870  static PY_UINT64_T __pyx_dict_version = 0;\
1871  static PyObject *__pyx_dict_cached_value = NULL;\
1872  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1873  (VAR) = __pyx_dict_cached_value;\
1874  } else {\
1875  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1876  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1877  }\
1878 }
1879 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1880 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1881 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1882 #else
1883 #define __PYX_GET_DICT_VERSION(dict) (0)
1884 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1885 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1886 #endif
1887 
1888 /* GetModuleGlobalName.proto */
1889 #if CYTHON_USE_DICT_VERSIONS
1890 #define __Pyx_GetModuleGlobalName(var, name) {\
1891  static PY_UINT64_T __pyx_dict_version = 0;\
1892  static PyObject *__pyx_dict_cached_value = NULL;\
1893  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1894  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1895  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1896 }
1897 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1898  PY_UINT64_T __pyx_dict_version;\
1899  PyObject *__pyx_dict_cached_value;\
1900  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1901 }
1902 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1903 #else
1904 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1905 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1906 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1907 #endif
1908 
1909 /* SwapException.proto */
1910 #if CYTHON_FAST_THREAD_STATE
1911 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1912 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1913 #else
1914 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1915 #endif
1916 
1917 /* Import.proto */
1918 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1919 
1920 /* FastTypeChecks.proto */
1921 #if CYTHON_COMPILING_IN_CPYTHON
1922 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1923 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1924 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1925 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1926 #else
1927 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1928 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1929 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1930 #endif
1931 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1932 
1933 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1934 /* ListCompAppend.proto */
1935 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1936 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1937  PyListObject* L = (PyListObject*) list;
1938  Py_ssize_t len = Py_SIZE(list);
1939  if (likely(L->allocated > len)) {
1940  Py_INCREF(x);
1941  PyList_SET_ITEM(list, len, x);
1942  __Pyx_SET_SIZE(list, len + 1);
1943  return 0;
1944  }
1945  return PyList_Append(list, x);
1946 }
1947 #else
1948 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1949 #endif
1950 
1951 /* ListExtend.proto */
1952 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1953 #if CYTHON_COMPILING_IN_CPYTHON
1954  PyObject* none = _PyList_Extend((PyListObject*)L, v);
1955  if (unlikely(!none))
1956  return -1;
1957  Py_DECREF(none);
1958  return 0;
1959 #else
1960  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
1961 #endif
1962 }
1963 
1964 /* ListAppend.proto */
1965 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1966 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1967  PyListObject* L = (PyListObject*) list;
1968  Py_ssize_t len = Py_SIZE(list);
1969  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1970  Py_INCREF(x);
1971  PyList_SET_ITEM(list, len, x);
1972  __Pyx_SET_SIZE(list, len + 1);
1973  return 0;
1974  }
1975  return PyList_Append(list, x);
1976 }
1977 #else
1978 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1979 #endif
1980 
1981 /* None.proto */
1982 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
1983 
1984 /* None.proto */
1985 static CYTHON_INLINE long __Pyx_div_long(long, long);
1986 
1987 /* ImportFrom.proto */
1988 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1989 
1990 /* HasAttr.proto */
1991 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1992 
1993 /* PyObject_GenericGetAttrNoDict.proto */
1994 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1995 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1996 #else
1997 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1998 #endif
1999 
2000 /* PyObject_GenericGetAttr.proto */
2001 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2002 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2003 #else
2004 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2005 #endif
2006 
2007 /* PyObjectGetAttrStrNoError.proto */
2008 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2009 
2010 /* SetupReduce.proto */
2011 static int __Pyx_setup_reduce(PyObject* type_obj);
2012 
2013 /* SetVTable.proto */
2014 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2015 
2016 /* TypeImport.proto */
2017 #ifndef __PYX_HAVE_RT_ImportType_proto
2018 #define __PYX_HAVE_RT_ImportType_proto
2019 enum __Pyx_ImportType_CheckSize {
2020  __Pyx_ImportType_CheckSize_Error = 0,
2021  __Pyx_ImportType_CheckSize_Warn = 1,
2022  __Pyx_ImportType_CheckSize_Ignore = 2
2023 };
2024 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2025 #endif
2026 
2027 /* CalculateMetaclass.proto */
2028 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
2029 
2030 /* FetchCommonType.proto */
2031 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2032 
2033 /* CythonFunctionShared.proto */
2034 #define __Pyx_CyFunction_USED 1
2035 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2036 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2037 #define __Pyx_CYFUNCTION_CCLASS 0x04
2038 #define __Pyx_CyFunction_GetClosure(f)\
2039  (((__pyx_CyFunctionObject *) (f))->func_closure)
2040 #define __Pyx_CyFunction_GetClassObj(f)\
2041  (((__pyx_CyFunctionObject *) (f))->func_classobj)
2042 #define __Pyx_CyFunction_Defaults(type, f)\
2043  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2044 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2045  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2046 typedef struct {
2047  PyCFunctionObject func;
2048 #if PY_VERSION_HEX < 0x030500A0
2049  PyObject *func_weakreflist;
2050 #endif
2051  PyObject *func_dict;
2052  PyObject *func_name;
2053  PyObject *func_qualname;
2054  PyObject *func_doc;
2055  PyObject *func_globals;
2056  PyObject *func_code;
2057  PyObject *func_closure;
2058  PyObject *func_classobj;
2059  void *defaults;
2060  int defaults_pyobjects;
2061  size_t defaults_size; // used by FusedFunction for copying defaults
2062  int flags;
2063  PyObject *defaults_tuple;
2064  PyObject *defaults_kwdict;
2065  PyObject *(*defaults_getter)(PyObject *);
2066  PyObject *func_annotations;
2067 } __pyx_CyFunctionObject;
2068 static PyTypeObject *__pyx_CyFunctionType = 0;
2069 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2070 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2071  int flags, PyObject* qualname,
2072  PyObject *self,
2073  PyObject *module, PyObject *globals,
2074  PyObject* code);
2075 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2076  size_t size,
2077  int pyobjects);
2078 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2079  PyObject *tuple);
2080 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2081  PyObject *dict);
2082 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2083  PyObject *dict);
2084 static int __pyx_CyFunction_init(void);
2085 
2086 /* CythonFunction.proto */
2087 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2088  int flags, PyObject* qualname,
2089  PyObject *closure,
2090  PyObject *module, PyObject *globals,
2091  PyObject* code);
2092 
2093 /* SetNameInClass.proto */
2094 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
2095 #define __Pyx_SetNameInClass(ns, name, value)\
2096  (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
2097 #elif CYTHON_COMPILING_IN_CPYTHON
2098 #define __Pyx_SetNameInClass(ns, name, value)\
2099  (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
2100 #else
2101 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
2102 #endif
2103 
2104 /* Py3ClassCreate.proto */
2105 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
2106  PyObject *mkw, PyObject *modname, PyObject *doc);
2107 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
2108  PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
2109 
2110 /* CLineInTraceback.proto */
2111 #ifdef CYTHON_CLINE_IN_TRACEBACK
2112 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2113 #else
2114 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2115 #endif
2116 
2117 /* CodeObjectCache.proto */
2118 typedef struct {
2119  PyCodeObject* code_object;
2120  int code_line;
2121 } __Pyx_CodeObjectCacheEntry;
2122 struct __Pyx_CodeObjectCache {
2123  int count;
2124  int max_count;
2125  __Pyx_CodeObjectCacheEntry* entries;
2126 };
2127 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2128 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2129 static PyCodeObject *__pyx_find_code_object(int code_line);
2130 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2131 
2132 /* AddTraceback.proto */
2133 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2134  int py_line, const char *filename);
2135 
2136 #if PY_MAJOR_VERSION < 3
2137  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2138  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2139 #else
2140  #define __Pyx_GetBuffer PyObject_GetBuffer
2141  #define __Pyx_ReleaseBuffer PyBuffer_Release
2142 #endif
2143 
2144 
2145 /* BufferStructDeclare.proto */
2146 typedef struct {
2147  Py_ssize_t shape, strides, suboffsets;
2148 } __Pyx_Buf_DimInfo;
2149 typedef struct {
2150  size_t refcount;
2151  Py_buffer pybuffer;
2152 } __Pyx_Buffer;
2153 typedef struct {
2154  __Pyx_Buffer *rcbuffer;
2155  char *data;
2156  __Pyx_Buf_DimInfo diminfo[8];
2157 } __Pyx_LocalBuf_ND;
2158 
2159 /* MemviewSliceIsContig.proto */
2160 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2161 
2162 /* OverlappingSlices.proto */
2163 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2164  __Pyx_memviewslice *slice2,
2165  int ndim, size_t itemsize);
2166 
2167 /* Capsule.proto */
2168 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2169 
2170 /* IsLittleEndian.proto */
2171 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2172 
2173 /* BufferFormatCheck.proto */
2174 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2175 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2176  __Pyx_BufFmt_StackElem* stack,
2177  __Pyx_TypeInfo* type);
2178 
2179 /* TypeInfoCompare.proto */
2180 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2181 
2182 /* MemviewSliceValidateAndInit.proto */
2183 static int __Pyx_ValidateAndInit_memviewslice(
2184  int *axes_specs,
2185  int c_or_f_flag,
2186  int buf_flags,
2187  int ndim,
2188  __Pyx_TypeInfo *dtype,
2189  __Pyx_BufFmt_StackElem stack[],
2190  __Pyx_memviewslice *memviewslice,
2191  PyObject *original_obj);
2192 
2193 /* ObjectToMemviewSlice.proto */
2194 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *, int writable_flag);
2195 
2196 /* ObjectToMemviewSlice.proto */
2197 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *, int writable_flag);
2198 
2199 /* CIntToPy.proto */
2200 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);
2201 
2202 /* CIntToPy.proto */
2203 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2204 
2205 /* RealImag.proto */
2206 #if CYTHON_CCOMPLEX
2207  #ifdef __cplusplus
2208  #define __Pyx_CREAL(z) ((z).real())
2209  #define __Pyx_CIMAG(z) ((z).imag())
2210  #else
2211  #define __Pyx_CREAL(z) (__real__(z))
2212  #define __Pyx_CIMAG(z) (__imag__(z))
2213  #endif
2214 #else
2215  #define __Pyx_CREAL(z) ((z).real)
2216  #define __Pyx_CIMAG(z) ((z).imag)
2217 #endif
2218 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2219  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2220  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2221  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2222 #else
2223  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2224  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2225 #endif
2226 
2227 /* Arithmetic.proto */
2228 #if CYTHON_CCOMPLEX
2229  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2230  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2231  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2232  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2233  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2234  #define __Pyx_c_neg_float(a) (-(a))
2235  #ifdef __cplusplus
2236  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2237  #define __Pyx_c_conj_float(z) (::std::conj(z))
2238  #if 1
2239  #define __Pyx_c_abs_float(z) (::std::abs(z))
2240  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2241  #endif
2242  #else
2243  #define __Pyx_c_is_zero_float(z) ((z)==0)
2244  #define __Pyx_c_conj_float(z) (conjf(z))
2245  #if 1
2246  #define __Pyx_c_abs_float(z) (cabsf(z))
2247  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2248  #endif
2249  #endif
2250 #else
2251  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2252  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2253  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2254  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2255  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2256  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2257  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2258  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2259  #if 1
2260  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2261  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2262  #endif
2263 #endif
2264 
2265 /* Arithmetic.proto */
2266 #if CYTHON_CCOMPLEX
2267  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2268  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2269  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2270  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2271  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2272  #define __Pyx_c_neg_double(a) (-(a))
2273  #ifdef __cplusplus
2274  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2275  #define __Pyx_c_conj_double(z) (::std::conj(z))
2276  #if 1
2277  #define __Pyx_c_abs_double(z) (::std::abs(z))
2278  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2279  #endif
2280  #else
2281  #define __Pyx_c_is_zero_double(z) ((z)==0)
2282  #define __Pyx_c_conj_double(z) (conj(z))
2283  #if 1
2284  #define __Pyx_c_abs_double(z) (cabs(z))
2285  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2286  #endif
2287  #endif
2288 #else
2289  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2290  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2291  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2292  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2293  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2294  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2295  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2296  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2297  #if 1
2298  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2299  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2300  #endif
2301 #endif
2302 
2303 /* CIntToPy.proto */
2304 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
2305 
2306 /* MemviewSliceCopyTemplate.proto */
2307 static __Pyx_memviewslice
2308 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2309  const char *mode, int ndim,
2310  size_t sizeof_dtype, int contig_flag,
2311  int dtype_is_object);
2312 
2313 /* CIntFromPy.proto */
2314 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2315 
2316 /* CIntFromPy.proto */
2317 static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);
2318 
2319 /* CIntFromPy.proto */
2320 static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
2321 
2322 /* CIntFromPy.proto */
2323 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2324 
2325 /* CIntToPy.proto */
2326 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2327 
2328 /* CIntFromPy.proto */
2329 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2330 
2331 /* CheckBinaryVersion.proto */
2332 static int __Pyx_check_binary_version(void);
2333 
2334 /* InitStrings.proto */
2335 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2336 
2337 static PyObject *__pyx_f_15superluWrappers_12SparseFactor__set_mat_types(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self); /* proto*/
2338 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2339 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2340 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2341 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2342 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2343 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2344 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2345 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2346 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2347 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2348 
2349 /* Module declarations from 'cpython.buffer' */
2350 
2351 /* Module declarations from 'libc.string' */
2352 
2353 /* Module declarations from 'libc.stdio' */
2354 
2355 /* Module declarations from '__builtin__' */
2356 
2357 /* Module declarations from 'cpython.type' */
2358 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2359 
2360 /* Module declarations from 'cpython' */
2361 
2362 /* Module declarations from 'cpython.object' */
2363 
2364 /* Module declarations from 'cpython.ref' */
2365 
2366 /* Module declarations from 'cpython.mem' */
2367 
2368 /* Module declarations from 'numpy' */
2369 
2370 /* Module declarations from 'numpy' */
2371 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2372 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2373 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2374 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2375 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2376 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
2377 
2378 /* Module declarations from 'cython.view' */
2379 
2380 /* Module declarations from 'cython' */
2381 
2382 /* Module declarations from 'libc.stdlib' */
2383 
2384 /* Module declarations from 'superluWrappers' */
2385 static PyTypeObject *__pyx_ptype_15superluWrappers_cSparseMatrix = 0;
2386 static PyTypeObject *__pyx_ptype_15superluWrappers_SparseFactor = 0;
2387 static PyTypeObject *__pyx_array_type = 0;
2388 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2389 static PyTypeObject *__pyx_memoryview_type = 0;
2390 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2391 static PyObject *generic = 0;
2392 static PyObject *strided = 0;
2393 static PyObject *indirect = 0;
2394 static PyObject *contiguous = 0;
2395 static PyObject *indirect_contiguous = 0;
2396 static int __pyx_memoryview_thread_locks_used;
2397 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2398 static void __pyx_f_15superluWrappers_SparseMatrix_matvec(struct __pyx_obj_15superluWrappers_cSparseMatrix *, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
2399 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(struct __pyx_obj_15superluWrappers_cSparseMatrix *, struct __pyx_obj_15superluWrappers_SparseFactor *); /*proto*/
2400 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(struct __pyx_obj_15superluWrappers_SparseFactor *, __Pyx_memviewslice); /*proto*/
2401 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2402 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2403 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2404 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2405 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2406 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2407 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2408 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2409 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2410 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2411 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2412 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2413 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2414 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2415 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2416 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2417 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2418 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2419 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2420 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2421 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2422 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2423 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2424 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2425 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2426 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2427 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2428 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2429 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2430 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2431 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2432 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2433 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2434 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 };
2435 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 };
2436 #define __Pyx_MODULE_NAME "superluWrappers"
2437 extern int __pyx_module_is_main_superluWrappers;
2438 int __pyx_module_is_main_superluWrappers = 0;
2439 
2440 /* Implementation of 'superluWrappers' */
2441 static PyObject *__pyx_builtin_object;
2442 static PyObject *__pyx_builtin_open;
2443 static PyObject *__pyx_builtin_range;
2444 static PyObject *__pyx_builtin_TypeError;
2445 static PyObject *__pyx_builtin_RuntimeError;
2446 static PyObject *__pyx_builtin_ValueError;
2447 static PyObject *__pyx_builtin_ImportError;
2448 static PyObject *__pyx_builtin_MemoryError;
2449 static PyObject *__pyx_builtin_enumerate;
2450 static PyObject *__pyx_builtin_Ellipsis;
2451 static PyObject *__pyx_builtin_id;
2452 static PyObject *__pyx_builtin_IndexError;
2453 static const char __pyx_k_O[] = "O";
2454 static const char __pyx_k_c[] = "c";
2455 static const char __pyx_k_i[] = "i";
2456 static const char __pyx_k_k[] = "k";
2457 static const char __pyx_k_w[] = "w";
2458 static const char __pyx_k_x[] = "x";
2459 static const char __pyx_k_y[] = "y";
2460 static const char __pyx_k_id[] = "id";
2461 static const char __pyx_k_nc[] = "nc";
2462 static const char __pyx_k_np[] = "np";
2463 static const char __pyx_k_nr[] = "nr";
2464 static const char __pyx_k_dim[] = "dim";
2465 static const char __pyx_k_doc[] = "__doc__";
2466 static const char __pyx_k_new[] = "__new__";
2467 static const char __pyx_k_nnz[] = "nnz";
2468 static const char __pyx_k_obj[] = "obj";
2469 static const char __pyx_k_base[] = "base";
2470 static const char __pyx_k_dict[] = "__dict__";
2471 static const char __pyx_k_exit[] = "__exit__";
2472 static const char __pyx_k_init[] = "__init__";
2473 static const char __pyx_k_main[] = "__main__";
2474 static const char __pyx_k_mode[] = "mode";
2475 static const char __pyx_k_name[] = "name";
2476 static const char __pyx_k_ndim[] = "ndim";
2477 static const char __pyx_k_open[] = "open";
2478 static const char __pyx_k_pack[] = "pack";
2479 static const char __pyx_k_rows[] = "_rows";
2480 static const char __pyx_k_self[] = "self";
2481 static const char __pyx_k_size[] = "size";
2482 static const char __pyx_k_step[] = "step";
2483 static const char __pyx_k_stop[] = "stop";
2484 static const char __pyx_k_test[] = "__test__";
2485 static const char __pyx_k_ASCII[] = "ASCII";
2486 static const char __pyx_k_class[] = "__class__";
2487 static const char __pyx_k_enter[] = "__enter__";
2488 static const char __pyx_k_error[] = "error";
2489 static const char __pyx_k_flags[] = "flags";
2490 static const char __pyx_k_i_i_i[] = "%i %i %i \n";
2491 static const char __pyx_k_numpy[] = "numpy";
2492 static const char __pyx_k_nzval[] = "nzval";
2493 static const char __pyx_k_range[] = "range";
2494 static const char __pyx_k_shape[] = "shape";
2495 static const char __pyx_k_start[] = "start";
2496 static const char __pyx_k_write[] = "write";
2497 static const char __pyx_k_colind[] = "colind";
2498 static const char __pyx_k_encode[] = "encode";
2499 static const char __pyx_k_format[] = "format";
2500 static const char __pyx_k_fwrite[] = "fwrite";
2501 static const char __pyx_k_import[] = "__import__";
2502 static const char __pyx_k_matvec[] = "matvec";
2503 static const char __pyx_k_module[] = "__module__";
2504 static const char __pyx_k_name_2[] = "__name__";
2505 static const char __pyx_k_nzvals[] = "nzvals";
2506 static const char __pyx_k_object[] = "object";
2507 static const char __pyx_k_pickle[] = "pickle";
2508 static const char __pyx_k_reduce[] = "__reduce__";
2509 static const char __pyx_k_rowptr[] = "rowptr";
2510 static const char __pyx_k_struct[] = "struct";
2511 static const char __pyx_k_unpack[] = "unpack";
2512 static const char __pyx_k_update[] = "update";
2513 static const char __pyx_k_fortran[] = "fortran";
2514 static const char __pyx_k_memview[] = "memview";
2515 static const char __pyx_k_prepare[] = "__prepare__";
2516 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2517 static const char __pyx_k_filename[] = "filename";
2518 static const char __pyx_k_getstate[] = "__getstate__";
2519 static const char __pyx_k_itemsize[] = "itemsize";
2520 static const char __pyx_k_pyx_type[] = "__pyx_type";
2521 static const char __pyx_k_qualname[] = "__qualname__";
2522 static const char __pyx_k_setstate[] = "__setstate__";
2523 static const char __pyx_k_TypeError[] = "TypeError";
2524 static const char __pyx_k_d_d_13_8e[] = "%d %d %13.8e\n";
2525 static const char __pyx_k_enumerate[] = "enumerate";
2526 static const char __pyx_k_metaclass[] = "__metaclass__";
2527 static const char __pyx_k_pyx_state[] = "__pyx_state";
2528 static const char __pyx_k_range_end[] = "range_end";
2529 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2530 static const char __pyx_k_IndexError[] = "IndexError";
2531 static const char __pyx_k_ValueError[] = "ValueError";
2532 static const char __pyx_k_pyx_result[] = "__pyx_result";
2533 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2534 static const char __pyx_k_ImportError[] = "ImportError";
2535 static const char __pyx_k_MemoryError[] = "MemoryError";
2536 static const char __pyx_k_PickleError[] = "PickleError";
2537 static const char __pyx_k_output_file[] = "output_file";
2538 static const char __pyx_k_range_start[] = "range_start";
2539 static const char __pyx_k_RuntimeError[] = "RuntimeError";
2540 static const char __pyx_k_SparseFactor[] = "SparseFactor";
2541 static const char __pyx_k_SparseMatrix[] = "SparseMatrix";
2542 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2543 static const char __pyx_k_sparseFactor[] = "sparseFactor";
2544 static const char __pyx_k_stringsource[] = "stringsource";
2545 static const char __pyx_k_cSparseMatrix[] = "_cSparseMatrix";
2546 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2547 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2548 static const char __pyx_k_sparse_matrix[] = "sparse_matrix";
2549 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2550 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2551 static const char __pyx_k_cSparseMatrix_2[] = "cSparseMatrix";
2552 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2553 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2554 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2555 static const char __pyx_k_superluWrappers[] = "superluWrappers";
2556 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2557 static const char __pyx_k_sparseFactorSolve[] = "sparseFactorSolve";
2558 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2559 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2560 static const char __pyx_k_SparseMatrix___init[] = "SparseMatrix.__init__";
2561 static const char __pyx_k_SparseMatrix_fwrite[] = "SparseMatrix.fwrite";
2562 static const char __pyx_k_SparseMatrix_matvec[] = "SparseMatrix.matvec";
2563 static const char __pyx_k_sparseFactorPrepare[] = "sparseFactorPrepare";
2564 static const char __pyx_k_getCSRrepresentation[] = "getCSRrepresentation";
2565 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2566 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2567 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2568 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2569 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2570 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2571 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2572 static const char __pyx_k_getSubMatCSRrepresentation[] = "getSubMatCSRrepresentation";
2573 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2574 static const char __pyx_k_proteus_superluWrappers_pyx[] = "proteus/superluWrappers.pyx";
2575 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2576 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2577 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2578 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
2579 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2580 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2581 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2582 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2583 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2584 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
2585 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2586 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2587 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2588 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
2589 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2590 static const char __pyx_k_SparseMatrix_getCSRrepresentatio[] = "SparseMatrix.getCSRrepresentation";
2591 static const char __pyx_k_SparseMatrix_getSubMatCSRreprese[] = "SparseMatrix.getSubMatCSRrepresentation";
2592 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2593 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2594 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2595 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2596 static const char __pyx_k_self_A_self_AC_self_L_self_U_sel[] = "self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling";
2597 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2598 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
2599 static PyObject *__pyx_n_s_ASCII;
2600 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2601 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2602 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2603 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2604 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2605 static PyObject *__pyx_n_s_Ellipsis;
2606 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2607 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2608 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2609 static PyObject *__pyx_n_s_ImportError;
2610 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2611 static PyObject *__pyx_n_s_IndexError;
2612 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2613 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2614 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2615 static PyObject *__pyx_n_s_MemoryError;
2616 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2617 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2618 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2619 static PyObject *__pyx_n_b_O;
2620 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2621 static PyObject *__pyx_n_s_PickleError;
2622 static PyObject *__pyx_n_s_RuntimeError;
2623 static PyObject *__pyx_n_s_SparseFactor;
2624 static PyObject *__pyx_n_s_SparseMatrix;
2625 static PyObject *__pyx_n_s_SparseMatrix___init;
2626 static PyObject *__pyx_n_s_SparseMatrix_fwrite;
2627 static PyObject *__pyx_n_s_SparseMatrix_getCSRrepresentatio;
2628 static PyObject *__pyx_n_s_SparseMatrix_getSubMatCSRreprese;
2629 static PyObject *__pyx_n_s_SparseMatrix_matvec;
2630 static PyObject *__pyx_n_s_TypeError;
2631 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2632 static PyObject *__pyx_n_s_ValueError;
2633 static PyObject *__pyx_n_s_View_MemoryView;
2634 static PyObject *__pyx_n_s_allocate_buffer;
2635 static PyObject *__pyx_n_s_base;
2636 static PyObject *__pyx_n_s_c;
2637 static PyObject *__pyx_n_u_c;
2638 static PyObject *__pyx_n_s_cSparseMatrix;
2639 static PyObject *__pyx_n_s_cSparseMatrix_2;
2640 static PyObject *__pyx_n_s_class;
2641 static PyObject *__pyx_n_s_cline_in_traceback;
2642 static PyObject *__pyx_n_s_colind;
2643 static PyObject *__pyx_kp_s_contiguous_and_direct;
2644 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2645 static PyObject *__pyx_kp_s_d_d_13_8e;
2646 static PyObject *__pyx_n_s_dict;
2647 static PyObject *__pyx_n_s_dim;
2648 static PyObject *__pyx_n_s_doc;
2649 static PyObject *__pyx_n_s_dtype_is_object;
2650 static PyObject *__pyx_n_s_encode;
2651 static PyObject *__pyx_n_s_enter;
2652 static PyObject *__pyx_n_s_enumerate;
2653 static PyObject *__pyx_n_s_error;
2654 static PyObject *__pyx_n_s_exit;
2655 static PyObject *__pyx_n_s_filename;
2656 static PyObject *__pyx_n_s_flags;
2657 static PyObject *__pyx_n_s_format;
2658 static PyObject *__pyx_n_s_fortran;
2659 static PyObject *__pyx_n_u_fortran;
2660 static PyObject *__pyx_n_s_fwrite;
2661 static PyObject *__pyx_n_s_getCSRrepresentation;
2662 static PyObject *__pyx_n_s_getSubMatCSRrepresentation;
2663 static PyObject *__pyx_n_s_getstate;
2664 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2665 static PyObject *__pyx_n_s_i;
2666 static PyObject *__pyx_kp_s_i_i_i;
2667 static PyObject *__pyx_n_s_id;
2668 static PyObject *__pyx_n_s_import;
2669 static PyObject *__pyx_n_s_init;
2670 static PyObject *__pyx_n_s_itemsize;
2671 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2672 static PyObject *__pyx_n_s_k;
2673 static PyObject *__pyx_n_s_main;
2674 static PyObject *__pyx_n_s_matvec;
2675 static PyObject *__pyx_n_s_memview;
2676 static PyObject *__pyx_n_s_metaclass;
2677 static PyObject *__pyx_n_s_mode;
2678 static PyObject *__pyx_n_s_module;
2679 static PyObject *__pyx_n_s_name;
2680 static PyObject *__pyx_n_s_name_2;
2681 static PyObject *__pyx_n_s_nc;
2682 static PyObject *__pyx_n_s_ndim;
2683 static PyObject *__pyx_n_s_new;
2684 static PyObject *__pyx_n_s_nnz;
2685 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2686 static PyObject *__pyx_n_s_np;
2687 static PyObject *__pyx_n_s_nr;
2688 static PyObject *__pyx_n_s_numpy;
2689 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2690 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2691 static PyObject *__pyx_n_s_nzval;
2692 static PyObject *__pyx_n_s_nzvals;
2693 static PyObject *__pyx_n_s_obj;
2694 static PyObject *__pyx_n_s_object;
2695 static PyObject *__pyx_n_s_open;
2696 static PyObject *__pyx_n_s_output_file;
2697 static PyObject *__pyx_n_s_pack;
2698 static PyObject *__pyx_n_s_pickle;
2699 static PyObject *__pyx_n_s_prepare;
2700 static PyObject *__pyx_kp_s_proteus_superluWrappers_pyx;
2701 static PyObject *__pyx_n_s_pyx_PickleError;
2702 static PyObject *__pyx_n_s_pyx_checksum;
2703 static PyObject *__pyx_n_s_pyx_getbuffer;
2704 static PyObject *__pyx_n_s_pyx_result;
2705 static PyObject *__pyx_n_s_pyx_state;
2706 static PyObject *__pyx_n_s_pyx_type;
2707 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2708 static PyObject *__pyx_n_s_pyx_vtable;
2709 static PyObject *__pyx_n_s_qualname;
2710 static PyObject *__pyx_n_s_range;
2711 static PyObject *__pyx_n_s_range_end;
2712 static PyObject *__pyx_n_s_range_start;
2713 static PyObject *__pyx_n_s_reduce;
2714 static PyObject *__pyx_n_s_reduce_cython;
2715 static PyObject *__pyx_n_s_reduce_ex;
2716 static PyObject *__pyx_n_s_rowptr;
2717 static PyObject *__pyx_n_s_rows;
2718 static PyObject *__pyx_n_s_self;
2719 static PyObject *__pyx_kp_s_self_A_self_AC_self_L_self_U_sel;
2720 static PyObject *__pyx_n_s_setstate;
2721 static PyObject *__pyx_n_s_setstate_cython;
2722 static PyObject *__pyx_n_s_shape;
2723 static PyObject *__pyx_n_s_size;
2724 static PyObject *__pyx_n_s_sparseFactor;
2725 static PyObject *__pyx_n_s_sparseFactorPrepare;
2726 static PyObject *__pyx_n_s_sparseFactorSolve;
2727 static PyObject *__pyx_n_s_sparse_matrix;
2728 static PyObject *__pyx_n_s_start;
2729 static PyObject *__pyx_n_s_step;
2730 static PyObject *__pyx_n_s_stop;
2731 static PyObject *__pyx_kp_s_strided_and_direct;
2732 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2733 static PyObject *__pyx_kp_s_strided_and_indirect;
2734 static PyObject *__pyx_kp_s_stringsource;
2735 static PyObject *__pyx_n_s_struct;
2736 static PyObject *__pyx_n_s_superluWrappers;
2737 static PyObject *__pyx_n_s_test;
2738 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2739 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2740 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2741 static PyObject *__pyx_n_s_unpack;
2742 static PyObject *__pyx_n_s_update;
2743 static PyObject *__pyx_n_s_w;
2744 static PyObject *__pyx_n_s_write;
2745 static PyObject *__pyx_n_s_x;
2746 static PyObject *__pyx_n_s_y;
2747 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc, PyObject *__pyx_v_nnz, PyObject *__pyx_v_nzvals, PyObject *__pyx_v_colind, PyObject *__pyx_v_rowptr); /* proto */
2748 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_2matvec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
2749 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_base); /* proto */
2750 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
2751 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_range_start, PyObject *__pyx_v_range_end); /* proto */
2752 static int __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, int __pyx_v_nr, int __pyx_v_nc, int __pyx_v_nnz, __Pyx_memviewslice __pyx_v_nzval, __Pyx_memviewslice __pyx_v_colind, __Pyx_memviewslice __pyx_v_rowptr); /* proto */
2753 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self); /* proto */
2754 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2755 static int __pyx_pf_15superluWrappers_12SparseFactor___init__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_dim); /* proto */
2756 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self); /* proto */
2757 static int __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2758 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self); /* proto */
2759 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2760 static PyObject *__pyx_pf_15superluWrappers_sparseFactorPrepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparse_matrix, PyObject *__pyx_v_sparseFactor); /* proto */
2761 static PyObject *__pyx_pf_15superluWrappers_2sparseFactorSolve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparseFactor, PyObject *__pyx_v_x); /* proto */
2762 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2763 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2764 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2765 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2766 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2767 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2768 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2769 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2770 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2771 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2772 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2773 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2774 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2775 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2776 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2777 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2778 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2779 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2780 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2781 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2782 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2783 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2784 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2785 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2786 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2787 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2788 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2789 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2790 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2791 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2792 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2793 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2794 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2795 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2796 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2797 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2798 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2799 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2800 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2801 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2802 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2803 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2804 static PyObject *__pyx_tp_new_15superluWrappers_cSparseMatrix(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2805 static PyObject *__pyx_tp_new_15superluWrappers_SparseFactor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2806 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2807 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2808 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2809 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2810 static PyObject *__pyx_int_0;
2811 static PyObject *__pyx_int_1;
2812 static PyObject *__pyx_int_184977713;
2813 static PyObject *__pyx_int_neg_1;
2814 static PyObject *__pyx_tuple_;
2815 static PyObject *__pyx_tuple__2;
2816 static PyObject *__pyx_tuple__3;
2817 static PyObject *__pyx_tuple__4;
2818 static PyObject *__pyx_tuple__5;
2819 static PyObject *__pyx_tuple__6;
2820 static PyObject *__pyx_tuple__7;
2821 static PyObject *__pyx_tuple__8;
2822 static PyObject *__pyx_tuple__9;
2823 static PyObject *__pyx_slice__25;
2824 static PyObject *__pyx_tuple__10;
2825 static PyObject *__pyx_tuple__11;
2826 static PyObject *__pyx_tuple__12;
2827 static PyObject *__pyx_tuple__13;
2828 static PyObject *__pyx_tuple__14;
2829 static PyObject *__pyx_tuple__15;
2830 static PyObject *__pyx_tuple__16;
2831 static PyObject *__pyx_tuple__17;
2832 static PyObject *__pyx_tuple__18;
2833 static PyObject *__pyx_tuple__19;
2834 static PyObject *__pyx_tuple__20;
2835 static PyObject *__pyx_tuple__21;
2836 static PyObject *__pyx_tuple__22;
2837 static PyObject *__pyx_tuple__23;
2838 static PyObject *__pyx_tuple__24;
2839 static PyObject *__pyx_tuple__26;
2840 static PyObject *__pyx_tuple__27;
2841 static PyObject *__pyx_tuple__28;
2842 static PyObject *__pyx_tuple__29;
2843 static PyObject *__pyx_tuple__30;
2844 static PyObject *__pyx_tuple__32;
2845 static PyObject *__pyx_tuple__34;
2846 static PyObject *__pyx_tuple__36;
2847 static PyObject *__pyx_tuple__38;
2848 static PyObject *__pyx_tuple__40;
2849 static PyObject *__pyx_tuple__42;
2850 static PyObject *__pyx_tuple__44;
2851 static PyObject *__pyx_tuple__45;
2852 static PyObject *__pyx_tuple__46;
2853 static PyObject *__pyx_tuple__47;
2854 static PyObject *__pyx_tuple__48;
2855 static PyObject *__pyx_tuple__49;
2856 static PyObject *__pyx_codeobj__31;
2857 static PyObject *__pyx_codeobj__33;
2858 static PyObject *__pyx_codeobj__35;
2859 static PyObject *__pyx_codeobj__37;
2860 static PyObject *__pyx_codeobj__39;
2861 static PyObject *__pyx_codeobj__41;
2862 static PyObject *__pyx_codeobj__43;
2863 static PyObject *__pyx_codeobj__50;
2864 /* Late includes */
2865 
2866 /* "superluWrappers.pyx":15
2867  * class SparseMatrix(object):
2868  *
2869  * def __init__(self, # <<<<<<<<<<<<<<
2870  * nr,
2871  * nc,
2872  */
2873 
2874 /* Python wrapper */
2875 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2876 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
2877 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2878  PyObject *__pyx_v_self = 0;
2879  PyObject *__pyx_v_nr = 0;
2880  PyObject *__pyx_v_nc = 0;
2881  PyObject *__pyx_v_nnz = 0;
2882  PyObject *__pyx_v_nzvals = 0;
2883  PyObject *__pyx_v_colind = 0;
2884  PyObject *__pyx_v_rowptr = 0;
2885  int __pyx_lineno = 0;
2886  const char *__pyx_filename = NULL;
2887  int __pyx_clineno = 0;
2888  PyObject *__pyx_r = 0;
2889  __Pyx_RefNannyDeclarations
2890  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
2891  {
2892  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_nr,&__pyx_n_s_nc,&__pyx_n_s_nnz,&__pyx_n_s_nzvals,&__pyx_n_s_colind,&__pyx_n_s_rowptr,0};
2893  PyObject* values[7] = {0,0,0,0,0,0,0};
2894  if (unlikely(__pyx_kwds)) {
2895  Py_ssize_t kw_args;
2896  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2897  switch (pos_args) {
2898  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2899  CYTHON_FALLTHROUGH;
2900  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2901  CYTHON_FALLTHROUGH;
2902  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2903  CYTHON_FALLTHROUGH;
2904  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2905  CYTHON_FALLTHROUGH;
2906  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2907  CYTHON_FALLTHROUGH;
2908  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2909  CYTHON_FALLTHROUGH;
2910  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2911  CYTHON_FALLTHROUGH;
2912  case 0: break;
2913  default: goto __pyx_L5_argtuple_error;
2914  }
2915  kw_args = PyDict_Size(__pyx_kwds);
2916  switch (pos_args) {
2917  case 0:
2918  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2919  else goto __pyx_L5_argtuple_error;
2920  CYTHON_FALLTHROUGH;
2921  case 1:
2922  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nr)) != 0)) kw_args--;
2923  else {
2924  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 1); __PYX_ERR(0, 15, __pyx_L3_error)
2925  }
2926  CYTHON_FALLTHROUGH;
2927  case 2:
2928  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc)) != 0)) kw_args--;
2929  else {
2930  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 2); __PYX_ERR(0, 15, __pyx_L3_error)
2931  }
2932  CYTHON_FALLTHROUGH;
2933  case 3:
2934  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
2935  else {
2936  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 3); __PYX_ERR(0, 15, __pyx_L3_error)
2937  }
2938  CYTHON_FALLTHROUGH;
2939  case 4:
2940  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nzvals)) != 0)) kw_args--;
2941  else {
2942  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 4); __PYX_ERR(0, 15, __pyx_L3_error)
2943  }
2944  CYTHON_FALLTHROUGH;
2945  case 5:
2946  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
2947  else {
2948  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 5); __PYX_ERR(0, 15, __pyx_L3_error)
2949  }
2950  CYTHON_FALLTHROUGH;
2951  case 6:
2952  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
2953  else {
2954  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 6); __PYX_ERR(0, 15, __pyx_L3_error)
2955  }
2956  }
2957  if (unlikely(kw_args > 0)) {
2958  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 15, __pyx_L3_error)
2959  }
2960  } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
2961  goto __pyx_L5_argtuple_error;
2962  } else {
2963  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2964  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2965  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2966  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2967  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2968  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2969  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2970  }
2971  __pyx_v_self = values[0];
2972  __pyx_v_nr = values[1];
2973  __pyx_v_nc = values[2];
2974  __pyx_v_nnz = values[3];
2975  __pyx_v_nzvals = values[4];
2976  __pyx_v_colind = values[5];
2977  __pyx_v_rowptr = values[6];
2978  }
2979  goto __pyx_L4_argument_unpacking_done;
2980  __pyx_L5_argtuple_error:;
2981  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 15, __pyx_L3_error)
2982  __pyx_L3_error:;
2983  __Pyx_AddTraceback("superluWrappers.SparseMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2984  __Pyx_RefNannyFinishContext();
2985  return NULL;
2986  __pyx_L4_argument_unpacking_done:;
2987  __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix___init__(__pyx_self, __pyx_v_self, __pyx_v_nr, __pyx_v_nc, __pyx_v_nnz, __pyx_v_nzvals, __pyx_v_colind, __pyx_v_rowptr);
2988 
2989  /* function exit code */
2990  __Pyx_RefNannyFinishContext();
2991  return __pyx_r;
2992 }
2993 
2994 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc, PyObject *__pyx_v_nnz, PyObject *__pyx_v_nzvals, PyObject *__pyx_v_colind, PyObject *__pyx_v_rowptr) {
2995  PyObject *__pyx_r = NULL;
2996  __Pyx_RefNannyDeclarations
2997  PyObject *__pyx_t_1 = NULL;
2998  PyObject *__pyx_t_2 = NULL;
2999  PyObject *__pyx_t_3 = NULL;
3000  PyObject *__pyx_t_4 = NULL;
3001  int __pyx_lineno = 0;
3002  const char *__pyx_filename = NULL;
3003  int __pyx_clineno = 0;
3004  __Pyx_RefNannySetupContext("__init__", 0);
3005 
3006  /* "superluWrappers.pyx":22
3007  * colind,
3008  * rowptr):
3009  * self.nr = nr ; self.nc = nc # <<<<<<<<<<<<<<
3010  * self.nnz = nnz
3011  * self.shape = [self.nr, self.nc]
3012  */
3013  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nr, __pyx_v_nr) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
3014  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nc, __pyx_v_nc) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
3015 
3016  /* "superluWrappers.pyx":23
3017  * rowptr):
3018  * self.nr = nr ; self.nc = nc
3019  * self.nnz = nnz # <<<<<<<<<<<<<<
3020  * self.shape = [self.nr, self.nc]
3021  * self.nzvals = nzvals
3022  */
3023  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nnz, __pyx_v_nnz) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
3024 
3025  /* "superluWrappers.pyx":24
3026  * self.nr = nr ; self.nc = nc
3027  * self.nnz = nnz
3028  * self.shape = [self.nr, self.nc] # <<<<<<<<<<<<<<
3029  * self.nzvals = nzvals
3030  * self.colind = colind
3031  */
3032  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
3033  __Pyx_GOTREF(__pyx_t_1);
3034  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
3035  __Pyx_GOTREF(__pyx_t_2);
3036  __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error)
3037  __Pyx_GOTREF(__pyx_t_3);
3038  __Pyx_GIVEREF(__pyx_t_1);
3039  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
3040  __Pyx_GIVEREF(__pyx_t_2);
3041  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
3042  __pyx_t_1 = 0;
3043  __pyx_t_2 = 0;
3044  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
3045  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3046 
3047  /* "superluWrappers.pyx":25
3048  * self.nnz = nnz
3049  * self.shape = [self.nr, self.nc]
3050  * self.nzvals = nzvals # <<<<<<<<<<<<<<
3051  * self.colind = colind
3052  * self.rowptr = rowptr
3053  */
3054  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nzvals, __pyx_v_nzvals) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
3055 
3056  /* "superluWrappers.pyx":26
3057  * self.shape = [self.nr, self.nc]
3058  * self.nzvals = nzvals
3059  * self.colind = colind # <<<<<<<<<<<<<<
3060  * self.rowptr = rowptr
3061  * self._cSparseMatrix = cSparseMatrix(nr,
3062  */
3063  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_colind, __pyx_v_colind) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
3064 
3065  /* "superluWrappers.pyx":27
3066  * self.nzvals = nzvals
3067  * self.colind = colind
3068  * self.rowptr = rowptr # <<<<<<<<<<<<<<
3069  * self._cSparseMatrix = cSparseMatrix(nr,
3070  * nc,
3071  */
3072  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rowptr, __pyx_v_rowptr) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
3073 
3074  /* "superluWrappers.pyx":31
3075  * nc,
3076  * nnz,
3077  * self.nzvals, # <<<<<<<<<<<<<<
3078  * self.colind,
3079  * self.rowptr)
3080  */
3081  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error)
3082  __Pyx_GOTREF(__pyx_t_3);
3083 
3084  /* "superluWrappers.pyx":32
3085  * nnz,
3086  * self.nzvals,
3087  * self.colind, # <<<<<<<<<<<<<<
3088  * self.rowptr)
3089  *
3090  */
3091  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
3092  __Pyx_GOTREF(__pyx_t_2);
3093 
3094  /* "superluWrappers.pyx":33
3095  * self.nzvals,
3096  * self.colind,
3097  * self.rowptr) # <<<<<<<<<<<<<<
3098  *
3099  * def matvec(self, x, y):
3100  */
3101  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
3102  __Pyx_GOTREF(__pyx_t_1);
3103 
3104  /* "superluWrappers.pyx":28
3105  * self.colind = colind
3106  * self.rowptr = rowptr
3107  * self._cSparseMatrix = cSparseMatrix(nr, # <<<<<<<<<<<<<<
3108  * nc,
3109  * nnz,
3110  */
3111  __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error)
3112  __Pyx_GOTREF(__pyx_t_4);
3113  __Pyx_INCREF(__pyx_v_nr);
3114  __Pyx_GIVEREF(__pyx_v_nr);
3115  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_nr);
3116  __Pyx_INCREF(__pyx_v_nc);
3117  __Pyx_GIVEREF(__pyx_v_nc);
3118  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_nc);
3119  __Pyx_INCREF(__pyx_v_nnz);
3120  __Pyx_GIVEREF(__pyx_v_nnz);
3121  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_nnz);
3122  __Pyx_GIVEREF(__pyx_t_3);
3123  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
3124  __Pyx_GIVEREF(__pyx_t_2);
3125  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_2);
3126  __Pyx_GIVEREF(__pyx_t_1);
3127  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_1);
3128  __pyx_t_3 = 0;
3129  __pyx_t_2 = 0;
3130  __pyx_t_1 = 0;
3131  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_15superluWrappers_cSparseMatrix), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
3132  __Pyx_GOTREF(__pyx_t_1);
3133  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3134  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cSparseMatrix, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
3135  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3136 
3137  /* "superluWrappers.pyx":15
3138  * class SparseMatrix(object):
3139  *
3140  * def __init__(self, # <<<<<<<<<<<<<<
3141  * nr,
3142  * nc,
3143  */
3144 
3145  /* function exit code */
3146  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3147  goto __pyx_L0;
3148  __pyx_L1_error:;
3149  __Pyx_XDECREF(__pyx_t_1);
3150  __Pyx_XDECREF(__pyx_t_2);
3151  __Pyx_XDECREF(__pyx_t_3);
3152  __Pyx_XDECREF(__pyx_t_4);
3153  __Pyx_AddTraceback("superluWrappers.SparseMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3154  __pyx_r = NULL;
3155  __pyx_L0:;
3156  __Pyx_XGIVEREF(__pyx_r);
3157  __Pyx_RefNannyFinishContext();
3158  return __pyx_r;
3159 }
3160 
3161 /* "superluWrappers.pyx":35
3162  * self.rowptr)
3163  *
3164  * def matvec(self, x, y): # <<<<<<<<<<<<<<
3165  * """
3166  * Compute the sparse matrix-vector product y = Ax
3167  */
3168 
3169 /* Python wrapper */
3170 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_3matvec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3171 static char __pyx_doc_15superluWrappers_12SparseMatrix_2matvec[] = "\n Compute the sparse matrix-vector product y = Ax\n\n Arguments\n ---------\n x (input) : numpy array\n y (output) : numpy array\n ";
3172 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_3matvec = {"matvec", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_3matvec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_2matvec};
3173 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_3matvec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3174  PyObject *__pyx_v_self = 0;
3175  PyObject *__pyx_v_x = 0;
3176  PyObject *__pyx_v_y = 0;
3177  int __pyx_lineno = 0;
3178  const char *__pyx_filename = NULL;
3179  int __pyx_clineno = 0;
3180  PyObject *__pyx_r = 0;
3181  __Pyx_RefNannyDeclarations
3182  __Pyx_RefNannySetupContext("matvec (wrapper)", 0);
3183  {
3184  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_y,0};
3185  PyObject* values[3] = {0,0,0};
3186  if (unlikely(__pyx_kwds)) {
3187  Py_ssize_t kw_args;
3188  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3189  switch (pos_args) {
3190  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3191  CYTHON_FALLTHROUGH;
3192  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3193  CYTHON_FALLTHROUGH;
3194  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3195  CYTHON_FALLTHROUGH;
3196  case 0: break;
3197  default: goto __pyx_L5_argtuple_error;
3198  }
3199  kw_args = PyDict_Size(__pyx_kwds);
3200  switch (pos_args) {
3201  case 0:
3202  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3203  else goto __pyx_L5_argtuple_error;
3204  CYTHON_FALLTHROUGH;
3205  case 1:
3206  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
3207  else {
3208  __Pyx_RaiseArgtupleInvalid("matvec", 1, 3, 3, 1); __PYX_ERR(0, 35, __pyx_L3_error)
3209  }
3210  CYTHON_FALLTHROUGH;
3211  case 2:
3212  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
3213  else {
3214  __Pyx_RaiseArgtupleInvalid("matvec", 1, 3, 3, 2); __PYX_ERR(0, 35, __pyx_L3_error)
3215  }
3216  }
3217  if (unlikely(kw_args > 0)) {
3218  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matvec") < 0)) __PYX_ERR(0, 35, __pyx_L3_error)
3219  }
3220  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3221  goto __pyx_L5_argtuple_error;
3222  } else {
3223  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3224  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3225  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3226  }
3227  __pyx_v_self = values[0];
3228  __pyx_v_x = values[1];
3229  __pyx_v_y = values[2];
3230  }
3231  goto __pyx_L4_argument_unpacking_done;
3232  __pyx_L5_argtuple_error:;
3233  __Pyx_RaiseArgtupleInvalid("matvec", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 35, __pyx_L3_error)
3234  __pyx_L3_error:;
3235  __Pyx_AddTraceback("superluWrappers.SparseMatrix.matvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
3236  __Pyx_RefNannyFinishContext();
3237  return NULL;
3238  __pyx_L4_argument_unpacking_done:;
3239  __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_2matvec(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y);
3240 
3241  /* function exit code */
3242  __Pyx_RefNannyFinishContext();
3243  return __pyx_r;
3244 }
3245 
3246 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_2matvec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
3247  PyObject *__pyx_r = NULL;
3248  __Pyx_RefNannyDeclarations
3249  PyObject *__pyx_t_1 = NULL;
3250  __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
3251  __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
3252  int __pyx_lineno = 0;
3253  const char *__pyx_filename = NULL;
3254  int __pyx_clineno = 0;
3255  __Pyx_RefNannySetupContext("matvec", 0);
3256 
3257  /* "superluWrappers.pyx":44
3258  * y (output) : numpy array
3259  * """
3260  * SparseMatrix_matvec(self._cSparseMatrix, x, y) # <<<<<<<<<<<<<<
3261  *
3262  * def fwrite(self, filename, base):
3263  */
3264  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
3265  __Pyx_GOTREF(__pyx_t_1);
3266  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 44, __pyx_L1_error)
3267  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_x, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 44, __pyx_L1_error)
3268  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_y, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 44, __pyx_L1_error)
3269  __pyx_f_15superluWrappers_SparseMatrix_matvec(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3);
3270  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3271  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
3272  __pyx_t_2.memview = NULL;
3273  __pyx_t_2.data = NULL;
3274  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
3275  __pyx_t_3.memview = NULL;
3276  __pyx_t_3.data = NULL;
3277 
3278  /* "superluWrappers.pyx":35
3279  * self.rowptr)
3280  *
3281  * def matvec(self, x, y): # <<<<<<<<<<<<<<
3282  * """
3283  * Compute the sparse matrix-vector product y = Ax
3284  */
3285 
3286  /* function exit code */
3287  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3288  goto __pyx_L0;
3289  __pyx_L1_error:;
3290  __Pyx_XDECREF(__pyx_t_1);
3291  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
3292  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
3293  __Pyx_AddTraceback("superluWrappers.SparseMatrix.matvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
3294  __pyx_r = NULL;
3295  __pyx_L0:;
3296  __Pyx_XGIVEREF(__pyx_r);
3297  __Pyx_RefNannyFinishContext();
3298  return __pyx_r;
3299 }
3300 
3301 /* "superluWrappers.pyx":46
3302  * SparseMatrix_matvec(self._cSparseMatrix, x, y)
3303  *
3304  * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
3305  * """ Write the sparse matrix to a file
3306  *
3307  */
3308 
3309 /* Python wrapper */
3310 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3311 static char __pyx_doc_15superluWrappers_12SparseMatrix_4fwrite[] = " Write the sparse matrix to a file\n\n Arguments\n ---------\n filename : str\n The output filename\n base : int\n ?!Possibly something to do with parallel?!\n ";
3312 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_5fwrite = {"fwrite", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_4fwrite};
3313 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3314  PyObject *__pyx_v_self = 0;
3315  PyObject *__pyx_v_filename = 0;
3316  PyObject *__pyx_v_base = 0;
3317  int __pyx_lineno = 0;
3318  const char *__pyx_filename = NULL;
3319  int __pyx_clineno = 0;
3320  PyObject *__pyx_r = 0;
3321  __Pyx_RefNannyDeclarations
3322  __Pyx_RefNannySetupContext("fwrite (wrapper)", 0);
3323  {
3324  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filename,&__pyx_n_s_base,0};
3325  PyObject* values[3] = {0,0,0};
3326  if (unlikely(__pyx_kwds)) {
3327  Py_ssize_t kw_args;
3328  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3329  switch (pos_args) {
3330  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3331  CYTHON_FALLTHROUGH;
3332  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3333  CYTHON_FALLTHROUGH;
3334  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3335  CYTHON_FALLTHROUGH;
3336  case 0: break;
3337  default: goto __pyx_L5_argtuple_error;
3338  }
3339  kw_args = PyDict_Size(__pyx_kwds);
3340  switch (pos_args) {
3341  case 0:
3342  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3343  else goto __pyx_L5_argtuple_error;
3344  CYTHON_FALLTHROUGH;
3345  case 1:
3346  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
3347  else {
3348  __Pyx_RaiseArgtupleInvalid("fwrite", 1, 3, 3, 1); __PYX_ERR(0, 46, __pyx_L3_error)
3349  }
3350  CYTHON_FALLTHROUGH;
3351  case 2:
3352  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base)) != 0)) kw_args--;
3353  else {
3354  __Pyx_RaiseArgtupleInvalid("fwrite", 1, 3, 3, 2); __PYX_ERR(0, 46, __pyx_L3_error)
3355  }
3356  }
3357  if (unlikely(kw_args > 0)) {
3358  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fwrite") < 0)) __PYX_ERR(0, 46, __pyx_L3_error)
3359  }
3360  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3361  goto __pyx_L5_argtuple_error;
3362  } else {
3363  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3364  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3365  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3366  }
3367  __pyx_v_self = values[0];
3368  __pyx_v_filename = values[1];
3369  __pyx_v_base = values[2];
3370  }
3371  goto __pyx_L4_argument_unpacking_done;
3372  __pyx_L5_argtuple_error:;
3373  __Pyx_RaiseArgtupleInvalid("fwrite", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 46, __pyx_L3_error)
3374  __pyx_L3_error:;
3375  __Pyx_AddTraceback("superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
3376  __Pyx_RefNannyFinishContext();
3377  return NULL;
3378  __pyx_L4_argument_unpacking_done:;
3379  __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(__pyx_self, __pyx_v_self, __pyx_v_filename, __pyx_v_base);
3380 
3381  /* function exit code */
3382  __Pyx_RefNannyFinishContext();
3383  return __pyx_r;
3384 }
3385 
3386 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_base) {
3387  PyObject *__pyx_v_output_file = NULL;
3388  PyObject *__pyx_v_i = NULL;
3389  PyObject *__pyx_v_k = NULL;
3390  PyObject *__pyx_r = NULL;
3391  __Pyx_RefNannyDeclarations
3392  PyObject *__pyx_t_1 = NULL;
3393  PyObject *__pyx_t_2 = NULL;
3394  PyObject *__pyx_t_3 = NULL;
3395  PyObject *__pyx_t_4 = NULL;
3396  PyObject *__pyx_t_5 = NULL;
3397  PyObject *__pyx_t_6 = NULL;
3398  PyObject *__pyx_t_7 = NULL;
3399  PyObject *__pyx_t_8 = NULL;
3400  PyObject *__pyx_t_9 = NULL;
3401  PyObject *__pyx_t_10 = NULL;
3402  PyObject *__pyx_t_11 = NULL;
3403  Py_ssize_t __pyx_t_12;
3404  PyObject *(*__pyx_t_13)(PyObject *);
3405  Py_ssize_t __pyx_t_14;
3406  PyObject *(*__pyx_t_15)(PyObject *);
3407  PyObject *__pyx_t_16 = NULL;
3408  PyObject *__pyx_t_17 = NULL;
3409  int __pyx_t_18;
3410  int __pyx_t_19;
3411  int __pyx_lineno = 0;
3412  const char *__pyx_filename = NULL;
3413  int __pyx_clineno = 0;
3414  __Pyx_RefNannySetupContext("fwrite", 0);
3415 
3416  /* "superluWrappers.pyx":56
3417  * ?!Possibly something to do with parallel?!
3418  * """
3419  * with open(filename, 'w') as output_file: # <<<<<<<<<<<<<<
3420  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3421  * for i in range(self.nr):
3422  */
3423  /*with:*/ {
3424  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
3425  __Pyx_GOTREF(__pyx_t_1);
3426  __Pyx_INCREF(__pyx_v_filename);
3427  __Pyx_GIVEREF(__pyx_v_filename);
3428  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
3429  __Pyx_INCREF(__pyx_n_s_w);
3430  __Pyx_GIVEREF(__pyx_n_s_w);
3431  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_w);
3432  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
3433  __Pyx_GOTREF(__pyx_t_2);
3434  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3435  __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
3436  __Pyx_GOTREF(__pyx_t_3);
3437  __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L3_error)
3438  __Pyx_GOTREF(__pyx_t_4);
3439  __pyx_t_5 = NULL;
3440  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3441  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3442  if (likely(__pyx_t_5)) {
3443  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3444  __Pyx_INCREF(__pyx_t_5);
3445  __Pyx_INCREF(function);
3446  __Pyx_DECREF_SET(__pyx_t_4, function);
3447  }
3448  }
3449  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
3450  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3451  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L3_error)
3452  __Pyx_GOTREF(__pyx_t_1);
3453  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3454  __pyx_t_4 = __pyx_t_1;
3455  __pyx_t_1 = 0;
3456  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3457  /*try:*/ {
3458  {
3459  __Pyx_PyThreadState_declare
3460  __Pyx_PyThreadState_assign
3461  __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
3462  __Pyx_XGOTREF(__pyx_t_6);
3463  __Pyx_XGOTREF(__pyx_t_7);
3464  __Pyx_XGOTREF(__pyx_t_8);
3465  /*try:*/ {
3466  __pyx_v_output_file = __pyx_t_4;
3467  __pyx_t_4 = 0;
3468 
3469  /* "superluWrappers.pyx":57
3470  * """
3471  * with open(filename, 'w') as output_file:
3472  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) ) # <<<<<<<<<<<<<<
3473  * for i in range(self.nr):
3474  * for k in range(self.rowptr[i], self.rowptr[i+1]):
3475  */
3476  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_file, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L7_error)
3477  __Pyx_GOTREF(__pyx_t_2);
3478  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L7_error)
3479  __Pyx_GOTREF(__pyx_t_1);
3480  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L7_error)
3481  __Pyx_GOTREF(__pyx_t_5);
3482  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 57, __pyx_L7_error)
3483  __Pyx_GOTREF(__pyx_t_9);
3484  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 57, __pyx_L7_error)
3485  __Pyx_GOTREF(__pyx_t_10);
3486  __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L7_error)
3487  __Pyx_GOTREF(__pyx_t_11);
3488  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3489  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3490  __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 57, __pyx_L7_error)
3491  __Pyx_GOTREF(__pyx_t_10);
3492  __Pyx_GIVEREF(__pyx_t_1);
3493  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
3494  __Pyx_GIVEREF(__pyx_t_5);
3495  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5);
3496  __Pyx_GIVEREF(__pyx_t_11);
3497  PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_11);
3498  __pyx_t_1 = 0;
3499  __pyx_t_5 = 0;
3500  __pyx_t_11 = 0;
3501  __pyx_t_11 = __Pyx_PyString_Format(__pyx_kp_s_i_i_i, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L7_error)
3502  __Pyx_GOTREF(__pyx_t_11);
3503  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3504  __pyx_t_10 = NULL;
3505  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3506  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
3507  if (likely(__pyx_t_10)) {
3508  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3509  __Pyx_INCREF(__pyx_t_10);
3510  __Pyx_INCREF(function);
3511  __Pyx_DECREF_SET(__pyx_t_2, function);
3512  }
3513  }
3514  __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_10, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_11);
3515  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3516  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3517  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L7_error)
3518  __Pyx_GOTREF(__pyx_t_4);
3519  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3520  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3521 
3522  /* "superluWrappers.pyx":58
3523  * with open(filename, 'w') as output_file:
3524  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3525  * for i in range(self.nr): # <<<<<<<<<<<<<<
3526  * for k in range(self.rowptr[i], self.rowptr[i+1]):
3527  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3528  */
3529  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L7_error)
3530  __Pyx_GOTREF(__pyx_t_4);
3531  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L7_error)
3532  __Pyx_GOTREF(__pyx_t_2);
3533  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3534  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
3535  __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_12 = 0;
3536  __pyx_t_13 = NULL;
3537  } else {
3538  __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L7_error)
3539  __Pyx_GOTREF(__pyx_t_4);
3540  __pyx_t_13 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 58, __pyx_L7_error)
3541  }
3542  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3543  for (;;) {
3544  if (likely(!__pyx_t_13)) {
3545  if (likely(PyList_CheckExact(__pyx_t_4))) {
3546  if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_4)) break;
3547  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3548  __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 58, __pyx_L7_error)
3549  #else
3550  __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L7_error)
3551  __Pyx_GOTREF(__pyx_t_2);
3552  #endif
3553  } else {
3554  if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
3555  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3556  __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 58, __pyx_L7_error)
3557  #else
3558  __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L7_error)
3559  __Pyx_GOTREF(__pyx_t_2);
3560  #endif
3561  }
3562  } else {
3563  __pyx_t_2 = __pyx_t_13(__pyx_t_4);
3564  if (unlikely(!__pyx_t_2)) {
3565  PyObject* exc_type = PyErr_Occurred();
3566  if (exc_type) {
3567  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3568  else __PYX_ERR(0, 58, __pyx_L7_error)
3569  }
3570  break;
3571  }
3572  __Pyx_GOTREF(__pyx_t_2);
3573  }
3574  __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
3575  __pyx_t_2 = 0;
3576 
3577  /* "superluWrappers.pyx":59
3578  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3579  * for i in range(self.nr):
3580  * for k in range(self.rowptr[i], self.rowptr[i+1]): # <<<<<<<<<<<<<<
3581  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3582  *
3583  */
3584  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L7_error)
3585  __Pyx_GOTREF(__pyx_t_2);
3586  __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_i); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 59, __pyx_L7_error)
3587  __Pyx_GOTREF(__pyx_t_11);
3588  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3589  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L7_error)
3590  __Pyx_GOTREF(__pyx_t_2);
3591  __pyx_t_10 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
3592  __Pyx_GOTREF(__pyx_t_10);
3593  __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L7_error)
3594  __Pyx_GOTREF(__pyx_t_5);
3595  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3596  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3597  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
3598  __Pyx_GOTREF(__pyx_t_10);
3599  __Pyx_GIVEREF(__pyx_t_11);
3600  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11);
3601  __Pyx_GIVEREF(__pyx_t_5);
3602  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5);
3603  __pyx_t_11 = 0;
3604  __pyx_t_5 = 0;
3605  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L7_error)
3606  __Pyx_GOTREF(__pyx_t_5);
3607  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3608  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
3609  __pyx_t_10 = __pyx_t_5; __Pyx_INCREF(__pyx_t_10); __pyx_t_14 = 0;
3610  __pyx_t_15 = NULL;
3611  } else {
3612  __pyx_t_14 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
3613  __Pyx_GOTREF(__pyx_t_10);
3614  __pyx_t_15 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 59, __pyx_L7_error)
3615  }
3616  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3617  for (;;) {
3618  if (likely(!__pyx_t_15)) {
3619  if (likely(PyList_CheckExact(__pyx_t_10))) {
3620  if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_10)) break;
3621  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3622  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_14); __Pyx_INCREF(__pyx_t_5); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 59, __pyx_L7_error)
3623  #else
3624  __pyx_t_5 = PySequence_ITEM(__pyx_t_10, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L7_error)
3625  __Pyx_GOTREF(__pyx_t_5);
3626  #endif
3627  } else {
3628  if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
3629  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3630  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_14); __Pyx_INCREF(__pyx_t_5); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 59, __pyx_L7_error)
3631  #else
3632  __pyx_t_5 = PySequence_ITEM(__pyx_t_10, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L7_error)
3633  __Pyx_GOTREF(__pyx_t_5);
3634  #endif
3635  }
3636  } else {
3637  __pyx_t_5 = __pyx_t_15(__pyx_t_10);
3638  if (unlikely(!__pyx_t_5)) {
3639  PyObject* exc_type = PyErr_Occurred();
3640  if (exc_type) {
3641  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3642  else __PYX_ERR(0, 59, __pyx_L7_error)
3643  }
3644  break;
3645  }
3646  __Pyx_GOTREF(__pyx_t_5);
3647  }
3648  __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5);
3649  __pyx_t_5 = 0;
3650 
3651  /* "superluWrappers.pyx":60
3652  * for i in range(self.nr):
3653  * for k in range(self.rowptr[i], self.rowptr[i+1]):
3654  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) ) # <<<<<<<<<<<<<<
3655  *
3656  * def getCSRrepresentation(self):
3657  */
3658  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_file, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L7_error)
3659  __Pyx_GOTREF(__pyx_t_11);
3660  __pyx_t_2 = PyNumber_Add(__pyx_v_i, __pyx_v_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L7_error)
3661  __Pyx_GOTREF(__pyx_t_2);
3662  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L7_error)
3663  __Pyx_GOTREF(__pyx_t_1);
3664  __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_k); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L7_error)
3665  __Pyx_GOTREF(__pyx_t_9);
3666  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3667  __pyx_t_1 = PyNumber_Add(__pyx_t_9, __pyx_v_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L7_error)
3668  __Pyx_GOTREF(__pyx_t_1);
3669  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3670  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L7_error)
3671  __Pyx_GOTREF(__pyx_t_9);
3672  __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_v_k); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 60, __pyx_L7_error)
3673  __Pyx_GOTREF(__pyx_t_16);
3674  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3675  __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L7_error)
3676  __Pyx_GOTREF(__pyx_t_9);
3677  __Pyx_GIVEREF(__pyx_t_2);
3678  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
3679  __Pyx_GIVEREF(__pyx_t_1);
3680  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
3681  __Pyx_GIVEREF(__pyx_t_16);
3682  PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_16);
3683  __pyx_t_2 = 0;
3684  __pyx_t_1 = 0;
3685  __pyx_t_16 = 0;
3686  __pyx_t_16 = __Pyx_PyString_Format(__pyx_kp_s_d_d_13_8e, __pyx_t_9); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 60, __pyx_L7_error)
3687  __Pyx_GOTREF(__pyx_t_16);
3688  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3689  __pyx_t_9 = NULL;
3690  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
3691  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11);
3692  if (likely(__pyx_t_9)) {
3693  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
3694  __Pyx_INCREF(__pyx_t_9);
3695  __Pyx_INCREF(function);
3696  __Pyx_DECREF_SET(__pyx_t_11, function);
3697  }
3698  }
3699  __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_9, __pyx_t_16) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_16);
3700  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3701  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3702  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 60, __pyx_L7_error)
3703  __Pyx_GOTREF(__pyx_t_5);
3704  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3705  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3706 
3707  /* "superluWrappers.pyx":59
3708  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3709  * for i in range(self.nr):
3710  * for k in range(self.rowptr[i], self.rowptr[i+1]): # <<<<<<<<<<<<<<
3711  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3712  *
3713  */
3714  }
3715  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3716 
3717  /* "superluWrappers.pyx":58
3718  * with open(filename, 'w') as output_file:
3719  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3720  * for i in range(self.nr): # <<<<<<<<<<<<<<
3721  * for k in range(self.rowptr[i], self.rowptr[i+1]):
3722  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3723  */
3724  }
3725  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3726 
3727  /* "superluWrappers.pyx":56
3728  * ?!Possibly something to do with parallel?!
3729  * """
3730  * with open(filename, 'w') as output_file: # <<<<<<<<<<<<<<
3731  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3732  * for i in range(self.nr):
3733  */
3734  }
3735  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3736  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3737  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3738  goto __pyx_L12_try_end;
3739  __pyx_L7_error:;
3740  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3741  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3742  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
3743  __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
3744  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3745  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3746  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3747  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3748  /*except:*/ {
3749  __Pyx_AddTraceback("superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
3750  if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_10, &__pyx_t_5) < 0) __PYX_ERR(0, 56, __pyx_L9_except_error)
3751  __Pyx_GOTREF(__pyx_t_4);
3752  __Pyx_GOTREF(__pyx_t_10);
3753  __Pyx_GOTREF(__pyx_t_5);
3754  __pyx_t_11 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 56, __pyx_L9_except_error)
3755  __Pyx_GOTREF(__pyx_t_11);
3756  __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL);
3757  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3758  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3759  if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 56, __pyx_L9_except_error)
3760  __Pyx_GOTREF(__pyx_t_17);
3761  __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_17);
3762  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3763  if (__pyx_t_18 < 0) __PYX_ERR(0, 56, __pyx_L9_except_error)
3764  __pyx_t_19 = ((!(__pyx_t_18 != 0)) != 0);
3765  if (__pyx_t_19) {
3766  __Pyx_GIVEREF(__pyx_t_4);
3767  __Pyx_GIVEREF(__pyx_t_10);
3768  __Pyx_XGIVEREF(__pyx_t_5);
3769  __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_10, __pyx_t_5);
3770  __pyx_t_4 = 0; __pyx_t_10 = 0; __pyx_t_5 = 0;
3771  __PYX_ERR(0, 56, __pyx_L9_except_error)
3772  }
3773  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3774  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3775  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3776  goto __pyx_L8_exception_handled;
3777  }
3778  __pyx_L9_except_error:;
3779  __Pyx_XGIVEREF(__pyx_t_6);
3780  __Pyx_XGIVEREF(__pyx_t_7);
3781  __Pyx_XGIVEREF(__pyx_t_8);
3782  __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3783  goto __pyx_L1_error;
3784  __pyx_L8_exception_handled:;
3785  __Pyx_XGIVEREF(__pyx_t_6);
3786  __Pyx_XGIVEREF(__pyx_t_7);
3787  __Pyx_XGIVEREF(__pyx_t_8);
3788  __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3789  __pyx_L12_try_end:;
3790  }
3791  }
3792  /*finally:*/ {
3793  /*normal exit:*/{
3794  if (__pyx_t_3) {
3795  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL);
3796  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3797  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 56, __pyx_L1_error)
3798  __Pyx_GOTREF(__pyx_t_8);
3799  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3800  }
3801  goto __pyx_L6;
3802  }
3803  __pyx_L6:;
3804  }
3805  goto __pyx_L20;
3806  __pyx_L3_error:;
3807  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3808  goto __pyx_L1_error;
3809  __pyx_L20:;
3810  }
3811 
3812  /* "superluWrappers.pyx":46
3813  * SparseMatrix_matvec(self._cSparseMatrix, x, y)
3814  *
3815  * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
3816  * """ Write the sparse matrix to a file
3817  *
3818  */
3819 
3820  /* function exit code */
3821  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3822  goto __pyx_L0;
3823  __pyx_L1_error:;
3824  __Pyx_XDECREF(__pyx_t_1);
3825  __Pyx_XDECREF(__pyx_t_2);
3826  __Pyx_XDECREF(__pyx_t_4);
3827  __Pyx_XDECREF(__pyx_t_5);
3828  __Pyx_XDECREF(__pyx_t_9);
3829  __Pyx_XDECREF(__pyx_t_10);
3830  __Pyx_XDECREF(__pyx_t_11);
3831  __Pyx_XDECREF(__pyx_t_16);
3832  __Pyx_AddTraceback("superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
3833  __pyx_r = NULL;
3834  __pyx_L0:;
3835  __Pyx_XDECREF(__pyx_v_output_file);
3836  __Pyx_XDECREF(__pyx_v_i);
3837  __Pyx_XDECREF(__pyx_v_k);
3838  __Pyx_XGIVEREF(__pyx_r);
3839  __Pyx_RefNannyFinishContext();
3840  return __pyx_r;
3841 }
3842 
3843 /* "superluWrappers.pyx":62
3844  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3845  *
3846  * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
3847  * """ Get the CSR representation of the sparse matrix.
3848  *
3849  */
3850 
3851 /* Python wrapper */
3852 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
3853 static char __pyx_doc_15superluWrappers_12SparseMatrix_6getCSRrepresentation[] = " Get the CSR representation of the sparse matrix.\n\n Returns\n -------\n csr_data : tuple of nparray\n (rowptr, colptr, vals)\n ";
3854 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_7getCSRrepresentation = {"getCSRrepresentation", (PyCFunction)__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation, METH_O, __pyx_doc_15superluWrappers_12SparseMatrix_6getCSRrepresentation};
3855 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_v_self) {
3856  PyObject *__pyx_r = 0;
3857  __Pyx_RefNannyDeclarations
3858  __Pyx_RefNannySetupContext("getCSRrepresentation (wrapper)", 0);
3859  __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(__pyx_self, ((PyObject *)__pyx_v_self));
3860 
3861  /* function exit code */
3862  __Pyx_RefNannyFinishContext();
3863  return __pyx_r;
3864 }
3865 
3866 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
3867  PyObject *__pyx_r = NULL;
3868  __Pyx_RefNannyDeclarations
3869  PyObject *__pyx_t_1 = NULL;
3870  PyObject *__pyx_t_2 = NULL;
3871  PyObject *__pyx_t_3 = NULL;
3872  PyObject *__pyx_t_4 = NULL;
3873  int __pyx_lineno = 0;
3874  const char *__pyx_filename = NULL;
3875  int __pyx_clineno = 0;
3876  __Pyx_RefNannySetupContext("getCSRrepresentation", 0);
3877 
3878  /* "superluWrappers.pyx":70
3879  * (rowptr, colptr, vals)
3880  * """
3881  * return (self.rowptr, self.colind, self.nzvals) # <<<<<<<<<<<<<<
3882  *
3883  * def getSubMatCSRrepresentation(self,
3884  */
3885  __Pyx_XDECREF(__pyx_r);
3886  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
3887  __Pyx_GOTREF(__pyx_t_1);
3888  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
3889  __Pyx_GOTREF(__pyx_t_2);
3890  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error)
3891  __Pyx_GOTREF(__pyx_t_3);
3892  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error)
3893  __Pyx_GOTREF(__pyx_t_4);
3894  __Pyx_GIVEREF(__pyx_t_1);
3895  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
3896  __Pyx_GIVEREF(__pyx_t_2);
3897  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
3898  __Pyx_GIVEREF(__pyx_t_3);
3899  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
3900  __pyx_t_1 = 0;
3901  __pyx_t_2 = 0;
3902  __pyx_t_3 = 0;
3903  __pyx_r = __pyx_t_4;
3904  __pyx_t_4 = 0;
3905  goto __pyx_L0;
3906 
3907  /* "superluWrappers.pyx":62
3908  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3909  *
3910  * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
3911  * """ Get the CSR representation of the sparse matrix.
3912  *
3913  */
3914 
3915  /* function exit code */
3916  __pyx_L1_error:;
3917  __Pyx_XDECREF(__pyx_t_1);
3918  __Pyx_XDECREF(__pyx_t_2);
3919  __Pyx_XDECREF(__pyx_t_3);
3920  __Pyx_XDECREF(__pyx_t_4);
3921  __Pyx_AddTraceback("superluWrappers.SparseMatrix.getCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
3922  __pyx_r = NULL;
3923  __pyx_L0:;
3924  __Pyx_XGIVEREF(__pyx_r);
3925  __Pyx_RefNannyFinishContext();
3926  return __pyx_r;
3927 }
3928 
3929 /* "superluWrappers.pyx":72
3930  * return (self.rowptr, self.colind, self.nzvals)
3931  *
3932  * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
3933  * range_start,
3934  * range_end):
3935  */
3936 
3937 /* Python wrapper */
3938 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3939 static char __pyx_doc_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation[] = " Get the CSR representation for a submatrix.\n\n Arguments\n ---------\n range_start : int\n range_end : int\n\n Returns\n -------\n csr_data : tuple of nparray\n (rowptr, colind, nzvals)\n ";
3940 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation = {"getSubMatCSRrepresentation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation};
3941 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3942  PyObject *__pyx_v_self = 0;
3943  PyObject *__pyx_v_range_start = 0;
3944  PyObject *__pyx_v_range_end = 0;
3945  int __pyx_lineno = 0;
3946  const char *__pyx_filename = NULL;
3947  int __pyx_clineno = 0;
3948  PyObject *__pyx_r = 0;
3949  __Pyx_RefNannyDeclarations
3950  __Pyx_RefNannySetupContext("getSubMatCSRrepresentation (wrapper)", 0);
3951  {
3952  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_range_start,&__pyx_n_s_range_end,0};
3953  PyObject* values[3] = {0,0,0};
3954  if (unlikely(__pyx_kwds)) {
3955  Py_ssize_t kw_args;
3956  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3957  switch (pos_args) {
3958  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3959  CYTHON_FALLTHROUGH;
3960  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3961  CYTHON_FALLTHROUGH;
3962  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3963  CYTHON_FALLTHROUGH;
3964  case 0: break;
3965  default: goto __pyx_L5_argtuple_error;
3966  }
3967  kw_args = PyDict_Size(__pyx_kwds);
3968  switch (pos_args) {
3969  case 0:
3970  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3971  else goto __pyx_L5_argtuple_error;
3972  CYTHON_FALLTHROUGH;
3973  case 1:
3974  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_range_start)) != 0)) kw_args--;
3975  else {
3976  __Pyx_RaiseArgtupleInvalid("getSubMatCSRrepresentation", 1, 3, 3, 1); __PYX_ERR(0, 72, __pyx_L3_error)
3977  }
3978  CYTHON_FALLTHROUGH;
3979  case 2:
3980  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_range_end)) != 0)) kw_args--;
3981  else {
3982  __Pyx_RaiseArgtupleInvalid("getSubMatCSRrepresentation", 1, 3, 3, 2); __PYX_ERR(0, 72, __pyx_L3_error)
3983  }
3984  }
3985  if (unlikely(kw_args > 0)) {
3986  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getSubMatCSRrepresentation") < 0)) __PYX_ERR(0, 72, __pyx_L3_error)
3987  }
3988  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3989  goto __pyx_L5_argtuple_error;
3990  } else {
3991  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3992  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3993  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3994  }
3995  __pyx_v_self = values[0];
3996  __pyx_v_range_start = values[1];
3997  __pyx_v_range_end = values[2];
3998  }
3999  goto __pyx_L4_argument_unpacking_done;
4000  __pyx_L5_argtuple_error:;
4001  __Pyx_RaiseArgtupleInvalid("getSubMatCSRrepresentation", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 72, __pyx_L3_error)
4002  __pyx_L3_error:;
4003  __Pyx_AddTraceback("superluWrappers.SparseMatrix.getSubMatCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
4004  __Pyx_RefNannyFinishContext();
4005  return NULL;
4006  __pyx_L4_argument_unpacking_done:;
4007  __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(__pyx_self, __pyx_v_self, __pyx_v_range_start, __pyx_v_range_end);
4008 
4009  /* function exit code */
4010  __Pyx_RefNannyFinishContext();
4011  return __pyx_r;
4012 }
4013 
4014 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_range_start, PyObject *__pyx_v_range_end) {
4015  PyObject *__pyx_v__rows = NULL;
4016  PyObject *__pyx_v_nnz = NULL;
4017  PyObject *__pyx_v_rowptr = NULL;
4018  PyObject *__pyx_v_colind = NULL;
4019  PyObject *__pyx_v_nzvals = NULL;
4020  PyObject *__pyx_r = NULL;
4021  __Pyx_RefNannyDeclarations
4022  PyObject *__pyx_t_1 = NULL;
4023  int __pyx_t_2;
4024  PyObject *__pyx_t_3 = NULL;
4025  PyObject *__pyx_t_4 = NULL;
4026  PyObject *__pyx_t_5 = NULL;
4027  int __pyx_lineno = 0;
4028  const char *__pyx_filename = NULL;
4029  int __pyx_clineno = 0;
4030  __Pyx_RefNannySetupContext("getSubMatCSRrepresentation", 0);
4031 
4032  /* "superluWrappers.pyx":87
4033  * (rowptr, colind, nzvals)
4034  * """
4035  * assert range_start >= 0 ; assert range_end <= self.nr # <<<<<<<<<<<<<<
4036  * assert range_end > range_start
4037  * _rows = range_end - range_start
4038  */
4039  #ifndef CYTHON_WITHOUT_ASSERTIONS
4040  if (unlikely(!Py_OptimizeFlag)) {
4041  __pyx_t_1 = PyObject_RichCompare(__pyx_v_range_start, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
4042  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 87, __pyx_L1_error)
4043  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4044  if (unlikely(!__pyx_t_2)) {
4045  PyErr_SetNone(PyExc_AssertionError);
4046  __PYX_ERR(0, 87, __pyx_L1_error)
4047  }
4048  }
4049  #endif
4050  #ifndef CYTHON_WITHOUT_ASSERTIONS
4051  if (unlikely(!Py_OptimizeFlag)) {
4052  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
4053  __Pyx_GOTREF(__pyx_t_1);
4054  __pyx_t_3 = PyObject_RichCompare(__pyx_v_range_end, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error)
4055  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4056  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 87, __pyx_L1_error)
4057  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4058  if (unlikely(!__pyx_t_2)) {
4059  PyErr_SetNone(PyExc_AssertionError);
4060  __PYX_ERR(0, 87, __pyx_L1_error)
4061  }
4062  }
4063  #endif
4064 
4065  /* "superluWrappers.pyx":88
4066  * """
4067  * assert range_start >= 0 ; assert range_end <= self.nr
4068  * assert range_end > range_start # <<<<<<<<<<<<<<
4069  * _rows = range_end - range_start
4070  * assert _rows <= self.nr
4071  */
4072  #ifndef CYTHON_WITHOUT_ASSERTIONS
4073  if (unlikely(!Py_OptimizeFlag)) {
4074  __pyx_t_3 = PyObject_RichCompare(__pyx_v_range_end, __pyx_v_range_start, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
4075  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 88, __pyx_L1_error)
4076  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4077  if (unlikely(!__pyx_t_2)) {
4078  PyErr_SetNone(PyExc_AssertionError);
4079  __PYX_ERR(0, 88, __pyx_L1_error)
4080  }
4081  }
4082  #endif
4083 
4084  /* "superluWrappers.pyx":89
4085  * assert range_start >= 0 ; assert range_end <= self.nr
4086  * assert range_end > range_start
4087  * _rows = range_end - range_start # <<<<<<<<<<<<<<
4088  * assert _rows <= self.nr
4089  *
4090  */
4091  __pyx_t_3 = PyNumber_Subtract(__pyx_v_range_end, __pyx_v_range_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
4092  __Pyx_GOTREF(__pyx_t_3);
4093  __pyx_v__rows = __pyx_t_3;
4094  __pyx_t_3 = 0;
4095 
4096  /* "superluWrappers.pyx":90
4097  * assert range_end > range_start
4098  * _rows = range_end - range_start
4099  * assert _rows <= self.nr # <<<<<<<<<<<<<<
4100  *
4101  * nnz = self.rowptr[range_end] - self.rowptr[range_start]
4102  */
4103  #ifndef CYTHON_WITHOUT_ASSERTIONS
4104  if (unlikely(!Py_OptimizeFlag)) {
4105  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error)
4106  __Pyx_GOTREF(__pyx_t_3);
4107  __pyx_t_1 = PyObject_RichCompare(__pyx_v__rows, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
4108  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4109  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 90, __pyx_L1_error)
4110  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4111  if (unlikely(!__pyx_t_2)) {
4112  PyErr_SetNone(PyExc_AssertionError);
4113  __PYX_ERR(0, 90, __pyx_L1_error)
4114  }
4115  }
4116  #endif
4117 
4118  /* "superluWrappers.pyx":92
4119  * assert _rows <= self.nr
4120  *
4121  * nnz = self.rowptr[range_end] - self.rowptr[range_start] # <<<<<<<<<<<<<<
4122  *
4123  * rowptr = self.rowptr[range_start : range_start + _rows + 1]
4124  */
4125  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
4126  __Pyx_GOTREF(__pyx_t_1);
4127  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_range_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error)
4128  __Pyx_GOTREF(__pyx_t_3);
4129  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4130  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
4131  __Pyx_GOTREF(__pyx_t_1);
4132  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_range_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
4133  __Pyx_GOTREF(__pyx_t_4);
4134  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4135  __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
4136  __Pyx_GOTREF(__pyx_t_1);
4137  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4138  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4139  __pyx_v_nnz = __pyx_t_1;
4140  __pyx_t_1 = 0;
4141 
4142  /* "superluWrappers.pyx":94
4143  * nnz = self.rowptr[range_end] - self.rowptr[range_start]
4144  *
4145  * rowptr = self.rowptr[range_start : range_start + _rows + 1] # <<<<<<<<<<<<<<
4146  * colind = self.colind[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4147  * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4148  */
4149  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
4150  __Pyx_GOTREF(__pyx_t_1);
4151  __pyx_t_4 = PyNumber_Add(__pyx_v_range_start, __pyx_v__rows); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
4152  __Pyx_GOTREF(__pyx_t_4);
4153  __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
4154  __Pyx_GOTREF(__pyx_t_3);
4155  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4156  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, 0, &__pyx_v_range_start, &__pyx_t_3, NULL, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
4157  __Pyx_GOTREF(__pyx_t_4);
4158  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4159  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4160  __pyx_v_rowptr = __pyx_t_4;
4161  __pyx_t_4 = 0;
4162 
4163  /* "superluWrappers.pyx":95
4164  *
4165  * rowptr = self.rowptr[range_start : range_start + _rows + 1]
4166  * colind = self.colind[self.rowptr[range_start] : self.rowptr[range_start] + nnz] # <<<<<<<<<<<<<<
4167  * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4168  *
4169  */
4170  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
4171  __Pyx_GOTREF(__pyx_t_4);
4172  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
4173  __Pyx_GOTREF(__pyx_t_3);
4174  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
4175  __Pyx_GOTREF(__pyx_t_1);
4176  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4177  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
4178  __Pyx_GOTREF(__pyx_t_3);
4179  __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error)
4180  __Pyx_GOTREF(__pyx_t_5);
4181  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4182  __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_v_nnz); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
4183  __Pyx_GOTREF(__pyx_t_3);
4184  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4185  __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 0, &__pyx_t_1, &__pyx_t_3, NULL, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error)
4186  __Pyx_GOTREF(__pyx_t_5);
4187  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4188  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4189  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4190  __pyx_v_colind = __pyx_t_5;
4191  __pyx_t_5 = 0;
4192 
4193  /* "superluWrappers.pyx":96
4194  * rowptr = self.rowptr[range_start : range_start + _rows + 1]
4195  * colind = self.colind[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4196  * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz] # <<<<<<<<<<<<<<
4197  *
4198  * return rowptr, colind, nzvals
4199  */
4200  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
4201  __Pyx_GOTREF(__pyx_t_5);
4202  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
4203  __Pyx_GOTREF(__pyx_t_3);
4204  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
4205  __Pyx_GOTREF(__pyx_t_1);
4206  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4207  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
4208  __Pyx_GOTREF(__pyx_t_3);
4209  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
4210  __Pyx_GOTREF(__pyx_t_4);
4211  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4212  __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_v_nnz); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
4213  __Pyx_GOTREF(__pyx_t_3);
4214  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4215  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_5, 0, 0, &__pyx_t_1, &__pyx_t_3, NULL, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
4216  __Pyx_GOTREF(__pyx_t_4);
4217  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4218  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4219  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4220  __pyx_v_nzvals = __pyx_t_4;
4221  __pyx_t_4 = 0;
4222 
4223  /* "superluWrappers.pyx":98
4224  * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4225  *
4226  * return rowptr, colind, nzvals # <<<<<<<<<<<<<<
4227  *
4228  * cdef class cSparseMatrix(object):
4229  */
4230  __Pyx_XDECREF(__pyx_r);
4231  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error)
4232  __Pyx_GOTREF(__pyx_t_4);
4233  __Pyx_INCREF(__pyx_v_rowptr);
4234  __Pyx_GIVEREF(__pyx_v_rowptr);
4235  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_rowptr);
4236  __Pyx_INCREF(__pyx_v_colind);
4237  __Pyx_GIVEREF(__pyx_v_colind);
4238  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_colind);
4239  __Pyx_INCREF(__pyx_v_nzvals);
4240  __Pyx_GIVEREF(__pyx_v_nzvals);
4241  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_nzvals);
4242  __pyx_r = __pyx_t_4;
4243  __pyx_t_4 = 0;
4244  goto __pyx_L0;
4245 
4246  /* "superluWrappers.pyx":72
4247  * return (self.rowptr, self.colind, self.nzvals)
4248  *
4249  * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
4250  * range_start,
4251  * range_end):
4252  */
4253 
4254  /* function exit code */
4255  __pyx_L1_error:;
4256  __Pyx_XDECREF(__pyx_t_1);
4257  __Pyx_XDECREF(__pyx_t_3);
4258  __Pyx_XDECREF(__pyx_t_4);
4259  __Pyx_XDECREF(__pyx_t_5);
4260  __Pyx_AddTraceback("superluWrappers.SparseMatrix.getSubMatCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
4261  __pyx_r = NULL;
4262  __pyx_L0:;
4263  __Pyx_XDECREF(__pyx_v__rows);
4264  __Pyx_XDECREF(__pyx_v_nnz);
4265  __Pyx_XDECREF(__pyx_v_rowptr);
4266  __Pyx_XDECREF(__pyx_v_colind);
4267  __Pyx_XDECREF(__pyx_v_nzvals);
4268  __Pyx_XGIVEREF(__pyx_r);
4269  __Pyx_RefNannyFinishContext();
4270  return __pyx_r;
4271 }
4272 
4273 /* "superluWrappers.pyx":102
4274  * cdef class cSparseMatrix(object):
4275  *
4276  * def __cinit__(self, # <<<<<<<<<<<<<<
4277  * int nr,
4278  * int nc,
4279  */
4280 
4281 /* Python wrapper */
4282 static int __pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4283 static int __pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4284  int __pyx_v_nr;
4285  int __pyx_v_nc;
4286  int __pyx_v_nnz;
4287  __Pyx_memviewslice __pyx_v_nzval = { 0, 0, { 0 }, { 0 }, { 0 } };
4288  __Pyx_memviewslice __pyx_v_colind = { 0, 0, { 0 }, { 0 }, { 0 } };
4289  __Pyx_memviewslice __pyx_v_rowptr = { 0, 0, { 0 }, { 0 }, { 0 } };
4290  int __pyx_lineno = 0;
4291  const char *__pyx_filename = NULL;
4292  int __pyx_clineno = 0;
4293  int __pyx_r;
4294  __Pyx_RefNannyDeclarations
4295  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
4296  {
4297  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nr,&__pyx_n_s_nc,&__pyx_n_s_nnz,&__pyx_n_s_nzval,&__pyx_n_s_colind,&__pyx_n_s_rowptr,0};
4298  PyObject* values[6] = {0,0,0,0,0,0};
4299  if (unlikely(__pyx_kwds)) {
4300  Py_ssize_t kw_args;
4301  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4302  switch (pos_args) {
4303  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4304  CYTHON_FALLTHROUGH;
4305  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4306  CYTHON_FALLTHROUGH;
4307  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4308  CYTHON_FALLTHROUGH;
4309  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4310  CYTHON_FALLTHROUGH;
4311  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4312  CYTHON_FALLTHROUGH;
4313  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4314  CYTHON_FALLTHROUGH;
4315  case 0: break;
4316  default: goto __pyx_L5_argtuple_error;
4317  }
4318  kw_args = PyDict_Size(__pyx_kwds);
4319  switch (pos_args) {
4320  case 0:
4321  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nr)) != 0)) kw_args--;
4322  else goto __pyx_L5_argtuple_error;
4323  CYTHON_FALLTHROUGH;
4324  case 1:
4325  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc)) != 0)) kw_args--;
4326  else {
4327  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 1); __PYX_ERR(0, 102, __pyx_L3_error)
4328  }
4329  CYTHON_FALLTHROUGH;
4330  case 2:
4331  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
4332  else {
4333  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 2); __PYX_ERR(0, 102, __pyx_L3_error)
4334  }
4335  CYTHON_FALLTHROUGH;
4336  case 3:
4337  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nzval)) != 0)) kw_args--;
4338  else {
4339  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 3); __PYX_ERR(0, 102, __pyx_L3_error)
4340  }
4341  CYTHON_FALLTHROUGH;
4342  case 4:
4343  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
4344  else {
4345  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 4); __PYX_ERR(0, 102, __pyx_L3_error)
4346  }
4347  CYTHON_FALLTHROUGH;
4348  case 5:
4349  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
4350  else {
4351  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 5); __PYX_ERR(0, 102, __pyx_L3_error)
4352  }
4353  }
4354  if (unlikely(kw_args > 0)) {
4355  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 102, __pyx_L3_error)
4356  }
4357  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4358  goto __pyx_L5_argtuple_error;
4359  } else {
4360  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4361  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4362  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4363  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4364  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4365  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4366  }
4367  __pyx_v_nr = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_nr == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L3_error)
4368  __pyx_v_nc = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error)
4369  __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error)
4370  __pyx_v_nzval = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_nzval.memview)) __PYX_ERR(0, 106, __pyx_L3_error)
4371  __pyx_v_colind = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_colind.memview)) __PYX_ERR(0, 107, __pyx_L3_error)
4372  __pyx_v_rowptr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_rowptr.memview)) __PYX_ERR(0, 108, __pyx_L3_error)
4373  }
4374  goto __pyx_L4_argument_unpacking_done;
4375  __pyx_L5_argtuple_error:;
4376  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 102, __pyx_L3_error)
4377  __pyx_L3_error:;
4378  __Pyx_AddTraceback("superluWrappers.cSparseMatrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4379  __Pyx_RefNannyFinishContext();
4380  return -1;
4381  __pyx_L4_argument_unpacking_done:;
4382  __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self), __pyx_v_nr, __pyx_v_nc, __pyx_v_nnz, __pyx_v_nzval, __pyx_v_colind, __pyx_v_rowptr);
4383 
4384  /* function exit code */
4385  __Pyx_RefNannyFinishContext();
4386  return __pyx_r;
4387 }
4388 
4389 static int __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, int __pyx_v_nr, int __pyx_v_nc, int __pyx_v_nnz, __Pyx_memviewslice __pyx_v_nzval, __Pyx_memviewslice __pyx_v_colind, __Pyx_memviewslice __pyx_v_rowptr) {
4390  int __pyx_r;
4391  __Pyx_RefNannyDeclarations
4392  Py_ssize_t __pyx_t_1;
4393  __Pyx_RefNannySetupContext("__cinit__", 0);
4394 
4395  /* "superluWrappers.pyx":109
4396  * np.int32_t [:] colind,
4397  * np.int32_t [:] rowptr):
4398  * self.dim[0] = nr ; self.dim[1] = nc # <<<<<<<<<<<<<<
4399  * self.A.nnz = nnz
4400  * #ARB - should memory for these ptrs need be allocated?
4401  */
4402  (__pyx_v_self->dim[0]) = __pyx_v_nr;
4403  (__pyx_v_self->dim[1]) = __pyx_v_nc;
4404 
4405  /* "superluWrappers.pyx":110
4406  * np.int32_t [:] rowptr):
4407  * self.dim[0] = nr ; self.dim[1] = nc
4408  * self.A.nnz = nnz # <<<<<<<<<<<<<<
4409  * #ARB - should memory for these ptrs need be allocated?
4410  * self.A.nzval = &nzval[0]
4411  */
4412  __pyx_v_self->A.nnz = __pyx_v_nnz;
4413 
4414  /* "superluWrappers.pyx":112
4415  * self.A.nnz = nnz
4416  * #ARB - should memory for these ptrs need be allocated?
4417  * self.A.nzval = &nzval[0] # <<<<<<<<<<<<<<
4418  * self.A.colind = &colind[0]
4419  * self.A.rowptr = &rowptr[0]
4420  */
4421  __pyx_t_1 = 0;
4422  __pyx_v_self->A.nzval = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_nzval.data + __pyx_t_1 * __pyx_v_nzval.strides[0]) ))));
4423 
4424  /* "superluWrappers.pyx":113
4425  * #ARB - should memory for these ptrs need be allocated?
4426  * self.A.nzval = &nzval[0]
4427  * self.A.colind = &colind[0] # <<<<<<<<<<<<<<
4428  * self.A.rowptr = &rowptr[0]
4429  *
4430  */
4431  __pyx_t_1 = 0;
4432  __pyx_v_self->A.colind = (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_colind.data + __pyx_t_1 * __pyx_v_colind.strides[0]) ))));
4433 
4434  /* "superluWrappers.pyx":114
4435  * self.A.nzval = &nzval[0]
4436  * self.A.colind = &colind[0]
4437  * self.A.rowptr = &rowptr[0] # <<<<<<<<<<<<<<
4438  *
4439  * cdef void SparseMatrix_matvec(cSparseMatrix sm,
4440  */
4441  __pyx_t_1 = 0;
4442  __pyx_v_self->A.rowptr = (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_rowptr.data + __pyx_t_1 * __pyx_v_rowptr.strides[0]) ))));
4443 
4444  /* "superluWrappers.pyx":102
4445  * cdef class cSparseMatrix(object):
4446  *
4447  * def __cinit__(self, # <<<<<<<<<<<<<<
4448  * int nr,
4449  * int nc,
4450  */
4451 
4452  /* function exit code */
4453  __pyx_r = 0;
4454  __PYX_XDEC_MEMVIEW(&__pyx_v_nzval, 1);
4455  __PYX_XDEC_MEMVIEW(&__pyx_v_colind, 1);
4456  __PYX_XDEC_MEMVIEW(&__pyx_v_rowptr, 1);
4457  __Pyx_RefNannyFinishContext();
4458  return __pyx_r;
4459 }
4460 
4461 /* "(tree fragment)":1
4462  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4463  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4464  * def __setstate_cython__(self, __pyx_state):
4465  */
4466 
4467 /* Python wrapper */
4468 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4469 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4470  PyObject *__pyx_r = 0;
4471  __Pyx_RefNannyDeclarations
4472  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
4473  __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self));
4474 
4475  /* function exit code */
4476  __Pyx_RefNannyFinishContext();
4477  return __pyx_r;
4478 }
4479 
4480 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self) {
4481  PyObject *__pyx_r = NULL;
4482  __Pyx_RefNannyDeclarations
4483  PyObject *__pyx_t_1 = NULL;
4484  int __pyx_lineno = 0;
4485  const char *__pyx_filename = NULL;
4486  int __pyx_clineno = 0;
4487  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
4488 
4489  /* "(tree fragment)":2
4490  * def __reduce_cython__(self):
4491  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4492  * def __setstate_cython__(self, __pyx_state):
4493  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4494  */
4495  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
4496  __Pyx_GOTREF(__pyx_t_1);
4497  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4498  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4499  __PYX_ERR(1, 2, __pyx_L1_error)
4500 
4501  /* "(tree fragment)":1
4502  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4503  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4504  * def __setstate_cython__(self, __pyx_state):
4505  */
4506 
4507  /* function exit code */
4508  __pyx_L1_error:;
4509  __Pyx_XDECREF(__pyx_t_1);
4510  __Pyx_AddTraceback("superluWrappers.cSparseMatrix.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4511  __pyx_r = NULL;
4512  __Pyx_XGIVEREF(__pyx_r);
4513  __Pyx_RefNannyFinishContext();
4514  return __pyx_r;
4515 }
4516 
4517 /* "(tree fragment)":3
4518  * def __reduce_cython__(self):
4519  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4520  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4521  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4522  */
4523 
4524 /* Python wrapper */
4525 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
4526 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4527  PyObject *__pyx_r = 0;
4528  __Pyx_RefNannyDeclarations
4529  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
4530  __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4531 
4532  /* function exit code */
4533  __Pyx_RefNannyFinishContext();
4534  return __pyx_r;
4535 }
4536 
4537 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
4538  PyObject *__pyx_r = NULL;
4539  __Pyx_RefNannyDeclarations
4540  PyObject *__pyx_t_1 = NULL;
4541  int __pyx_lineno = 0;
4542  const char *__pyx_filename = NULL;
4543  int __pyx_clineno = 0;
4544  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
4545 
4546  /* "(tree fragment)":4
4547  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4548  * def __setstate_cython__(self, __pyx_state):
4549  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4550  */
4551  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
4552  __Pyx_GOTREF(__pyx_t_1);
4553  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4554  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4555  __PYX_ERR(1, 4, __pyx_L1_error)
4556 
4557  /* "(tree fragment)":3
4558  * def __reduce_cython__(self):
4559  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4560  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4561  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4562  */
4563 
4564  /* function exit code */
4565  __pyx_L1_error:;
4566  __Pyx_XDECREF(__pyx_t_1);
4567  __Pyx_AddTraceback("superluWrappers.cSparseMatrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4568  __pyx_r = NULL;
4569  __Pyx_XGIVEREF(__pyx_r);
4570  __Pyx_RefNannyFinishContext();
4571  return __pyx_r;
4572 }
4573 
4574 /* "superluWrappers.pyx":116
4575  * self.A.rowptr = &rowptr[0]
4576  *
4577  * cdef void SparseMatrix_matvec(cSparseMatrix sm, # <<<<<<<<<<<<<<
4578  * np.float64_t [:] xp,
4579  * np.float64_t [:] yp):
4580  */
4581 
4582 static void __pyx_f_15superluWrappers_SparseMatrix_matvec(struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_sm, __Pyx_memviewslice __pyx_v_xp, __Pyx_memviewslice __pyx_v_yp) {
4583  __pyx_t_5numpy_float64_t __pyx_v_tmp;
4584  int __pyx_v_i;
4585  int __pyx_v_k;
4586  __Pyx_RefNannyDeclarations
4587  __pyx_t_5numpy_int32_t __pyx_t_1;
4588  __pyx_t_5numpy_int32_t __pyx_t_2;
4589  int __pyx_t_3;
4590  __pyx_t_5numpy_int32_t __pyx_t_4;
4591  __pyx_t_5numpy_int32_t __pyx_t_5;
4592  int __pyx_t_6;
4593  Py_ssize_t __pyx_t_7;
4594  __Pyx_RefNannySetupContext("SparseMatrix_matvec", 0);
4595 
4596  /* "superluWrappers.pyx":119
4597  * np.float64_t [:] xp,
4598  * np.float64_t [:] yp):
4599  * cdef np.float64_t tmp = 0. # <<<<<<<<<<<<<<
4600  * cdef int i, k
4601  *
4602  */
4603  __pyx_v_tmp = 0.;
4604 
4605  /* "superluWrappers.pyx":122
4606  * cdef int i, k
4607  *
4608  * for i in range(sm.dim[0]): # <<<<<<<<<<<<<<
4609  * tmp = 0.
4610  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]):
4611  */
4612  __pyx_t_1 = (__pyx_v_sm->dim[0]);
4613  __pyx_t_2 = __pyx_t_1;
4614  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
4615  __pyx_v_i = __pyx_t_3;
4616 
4617  /* "superluWrappers.pyx":123
4618  *
4619  * for i in range(sm.dim[0]):
4620  * tmp = 0. # <<<<<<<<<<<<<<
4621  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]):
4622  * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]]
4623  */
4624  __pyx_v_tmp = 0.;
4625 
4626  /* "superluWrappers.pyx":124
4627  * for i in range(sm.dim[0]):
4628  * tmp = 0.
4629  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]): # <<<<<<<<<<<<<<
4630  * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]]
4631  * yp[i] = tmp
4632  */
4633  __pyx_t_4 = (__pyx_v_sm->A.rowptr[(__pyx_v_i + 1)]);
4634  __pyx_t_5 = __pyx_t_4;
4635  for (__pyx_t_6 = (__pyx_v_sm->A.rowptr[__pyx_v_i]); __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
4636  __pyx_v_k = __pyx_t_6;
4637 
4638  /* "superluWrappers.pyx":125
4639  * tmp = 0.
4640  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]):
4641  * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]] # <<<<<<<<<<<<<<
4642  * yp[i] = tmp
4643  *
4644  */
4645  __pyx_t_7 = (__pyx_v_sm->A.colind[__pyx_v_k]);
4646  __pyx_v_tmp = (__pyx_v_tmp + ((__pyx_v_sm->A.nzval[__pyx_v_k]) * (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_xp.data + __pyx_t_7 * __pyx_v_xp.strides[0]) )))));
4647  }
4648 
4649  /* "superluWrappers.pyx":126
4650  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]):
4651  * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]]
4652  * yp[i] = tmp # <<<<<<<<<<<<<<
4653  *
4654  * cdef struct _NCformat:
4655  */
4656  __pyx_t_7 = __pyx_v_i;
4657  *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_yp.data + __pyx_t_7 * __pyx_v_yp.strides[0]) )) = __pyx_v_tmp;
4658  }
4659 
4660  /* "superluWrappers.pyx":116
4661  * self.A.rowptr = &rowptr[0]
4662  *
4663  * cdef void SparseMatrix_matvec(cSparseMatrix sm, # <<<<<<<<<<<<<<
4664  * np.float64_t [:] xp,
4665  * np.float64_t [:] yp):
4666  */
4667 
4668  /* function exit code */
4669  __Pyx_RefNannyFinishContext();
4670 }
4671 
4672 /* "superluWrappers.pyx":170
4673  * cdef public int dim
4674  *
4675  * def __init__(self, dim): # <<<<<<<<<<<<<<
4676  * """
4677  * Arguments
4678  */
4679 
4680 /* Python wrapper */
4681 static int __pyx_pw_15superluWrappers_12SparseFactor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4682 static char __pyx_doc_15superluWrappers_12SparseFactor___init__[] = "\n Arguments\n ---------\n dim : int\n Dimension of the sparse factor.\n ";
4683 #if CYTHON_COMPILING_IN_CPYTHON
4684 struct wrapperbase __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__;
4685 #endif
4686 static int __pyx_pw_15superluWrappers_12SparseFactor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4687  PyObject *__pyx_v_dim = 0;
4688  int __pyx_lineno = 0;
4689  const char *__pyx_filename = NULL;
4690  int __pyx_clineno = 0;
4691  int __pyx_r;
4692  __Pyx_RefNannyDeclarations
4693  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
4694  {
4695  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,0};
4696  PyObject* values[1] = {0};
4697  if (unlikely(__pyx_kwds)) {
4698  Py_ssize_t kw_args;
4699  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4700  switch (pos_args) {
4701  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4702  CYTHON_FALLTHROUGH;
4703  case 0: break;
4704  default: goto __pyx_L5_argtuple_error;
4705  }
4706  kw_args = PyDict_Size(__pyx_kwds);
4707  switch (pos_args) {
4708  case 0:
4709  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim)) != 0)) kw_args--;
4710  else goto __pyx_L5_argtuple_error;
4711  }
4712  if (unlikely(kw_args > 0)) {
4713  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 170, __pyx_L3_error)
4714  }
4715  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
4716  goto __pyx_L5_argtuple_error;
4717  } else {
4718  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4719  }
4720  __pyx_v_dim = values[0];
4721  }
4722  goto __pyx_L4_argument_unpacking_done;
4723  __pyx_L5_argtuple_error:;
4724  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 170, __pyx_L3_error)
4725  __pyx_L3_error:;
4726  __Pyx_AddTraceback("superluWrappers.SparseFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4727  __Pyx_RefNannyFinishContext();
4728  return -1;
4729  __pyx_L4_argument_unpacking_done:;
4730  __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor___init__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), __pyx_v_dim);
4731 
4732  /* function exit code */
4733  __Pyx_RefNannyFinishContext();
4734  return __pyx_r;
4735 }
4736 
4737 static int __pyx_pf_15superluWrappers_12SparseFactor___init__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_dim) {
4738  int __pyx_r;
4739  __Pyx_RefNannyDeclarations
4740  PyObject *__pyx_t_1 = NULL;
4741  int __pyx_t_2;
4742  __pyx_t_5numpy_int32_t __pyx_t_3;
4743  PyObject *__pyx_t_4 = NULL;
4744  size_t __pyx_t_5;
4745  int __pyx_lineno = 0;
4746  const char *__pyx_filename = NULL;
4747  int __pyx_clineno = 0;
4748  __Pyx_RefNannySetupContext("__init__", 0);
4749 
4750  /* "superluWrappers.pyx":177
4751  * Dimension of the sparse factor.
4752  * """
4753  * cStatInit(&self.stat) # <<<<<<<<<<<<<<
4754  * cset_default_options(&self.options)
4755  * self._set_mat_types()
4756  */
4757  StatInit((&__pyx_v_self->stat));
4758 
4759  /* "superluWrappers.pyx":178
4760  * """
4761  * cStatInit(&self.stat)
4762  * cset_default_options(&self.options) # <<<<<<<<<<<<<<
4763  * self._set_mat_types()
4764  * self.dim = dim
4765  */
4766  set_default_options((&__pyx_v_self->options));
4767 
4768  /* "superluWrappers.pyx":179
4769  * cStatInit(&self.stat)
4770  * cset_default_options(&self.options)
4771  * self._set_mat_types() # <<<<<<<<<<<<<<
4772  * self.dim = dim
4773  * self.A.nrow = dim ; self.A.ncol = dim
4774  */
4775  __pyx_t_1 = ((struct __pyx_vtabstruct_15superluWrappers_SparseFactor *)__pyx_v_self->__pyx_vtab)->_set_mat_types(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
4776  __Pyx_GOTREF(__pyx_t_1);
4777  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4778 
4779  /* "superluWrappers.pyx":180
4780  * cset_default_options(&self.options)
4781  * self._set_mat_types()
4782  * self.dim = dim # <<<<<<<<<<<<<<
4783  * self.A.nrow = dim ; self.A.ncol = dim
4784  * self.AC.nrow = dim ; self.AC.ncol = dim
4785  */
4786  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error)
4787  __pyx_v_self->dim = __pyx_t_2;
4788 
4789  /* "superluWrappers.pyx":181
4790  * self._set_mat_types()
4791  * self.dim = dim
4792  * self.A.nrow = dim ; self.A.ncol = dim # <<<<<<<<<<<<<<
4793  * self.AC.nrow = dim ; self.AC.ncol = dim
4794  * self.L.nrow = dim ; self.L.ncol = dim
4795  */
4796  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error)
4797  __pyx_v_self->A.nrow = __pyx_t_2;
4798  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error)
4799  __pyx_v_self->A.ncol = __pyx_t_2;
4800 
4801  /* "superluWrappers.pyx":182
4802  * self.dim = dim
4803  * self.A.nrow = dim ; self.A.ncol = dim
4804  * self.AC.nrow = dim ; self.AC.ncol = dim # <<<<<<<<<<<<<<
4805  * self.L.nrow = dim ; self.L.ncol = dim
4806  * self.U.nrow = dim ; self.U.ncol = dim
4807  */
4808  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L1_error)
4809  __pyx_v_self->AC.nrow = __pyx_t_2;
4810  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L1_error)
4811  __pyx_v_self->AC.ncol = __pyx_t_2;
4812 
4813  /* "superluWrappers.pyx":183
4814  * self.A.nrow = dim ; self.A.ncol = dim
4815  * self.AC.nrow = dim ; self.AC.ncol = dim
4816  * self.L.nrow = dim ; self.L.ncol = dim # <<<<<<<<<<<<<<
4817  * self.U.nrow = dim ; self.U.ncol = dim
4818  * self.X.nrow = dim ; self.X.ncol = 1
4819  */
4820  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error)
4821  __pyx_v_self->L.nrow = __pyx_t_2;
4822  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error)
4823  __pyx_v_self->L.ncol = __pyx_t_2;
4824 
4825  /* "superluWrappers.pyx":184
4826  * self.AC.nrow = dim ; self.AC.ncol = dim
4827  * self.L.nrow = dim ; self.L.ncol = dim
4828  * self.U.nrow = dim ; self.U.ncol = dim # <<<<<<<<<<<<<<
4829  * self.X.nrow = dim ; self.X.ncol = 1
4830  * self.storeX.lda = dim
4831  */
4832  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
4833  __pyx_v_self->U.nrow = __pyx_t_2;
4834  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
4835  __pyx_v_self->U.ncol = __pyx_t_2;
4836 
4837  /* "superluWrappers.pyx":185
4838  * self.L.nrow = dim ; self.L.ncol = dim
4839  * self.U.nrow = dim ; self.U.ncol = dim
4840  * self.X.nrow = dim ; self.X.ncol = 1 # <<<<<<<<<<<<<<
4841  * self.storeX.lda = dim
4842  * self.use_same_perm_c = 0
4843  */
4844  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
4845  __pyx_v_self->X.nrow = __pyx_t_2;
4846  __pyx_v_self->X.ncol = 1;
4847 
4848  /* "superluWrappers.pyx":186
4849  * self.U.nrow = dim ; self.U.ncol = dim
4850  * self.X.nrow = dim ; self.X.ncol = 1
4851  * self.storeX.lda = dim # <<<<<<<<<<<<<<
4852  * self.use_same_perm_c = 0
4853  * self.use_same_sparsity = 0
4854  */
4855  __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_v_dim); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
4856  __pyx_v_self->storeX.lda = __pyx_t_3;
4857 
4858  /* "superluWrappers.pyx":187
4859  * self.X.nrow = dim ; self.X.ncol = 1
4860  * self.storeX.lda = dim
4861  * self.use_same_perm_c = 0 # <<<<<<<<<<<<<<
4862  * self.use_same_sparsity = 0
4863  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
4864  */
4865  __pyx_v_self->use_same_perm_c = 0;
4866 
4867  /* "superluWrappers.pyx":188
4868  * self.storeX.lda = dim
4869  * self.use_same_perm_c = 0
4870  * self.use_same_sparsity = 0 # <<<<<<<<<<<<<<
4871  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
4872  * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t))
4873  */
4874  __pyx_v_self->use_same_sparsity = 0;
4875 
4876  /* "superluWrappers.pyx":189
4877  * self.use_same_perm_c = 0
4878  * self.use_same_sparsity = 0
4879  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t)) # <<<<<<<<<<<<<<
4880  * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t))
4881  * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
4882  */
4883  __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(__pyx_t_5numpy_int32_t))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
4884  __Pyx_GOTREF(__pyx_t_1);
4885  __pyx_t_4 = PyNumber_Multiply(__pyx_v_dim, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error)
4886  __Pyx_GOTREF(__pyx_t_4);
4887  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4888  __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error)
4889  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4890  __pyx_v_self->perm_c = ((int *)malloc(__pyx_t_5));
4891 
4892  /* "superluWrappers.pyx":190
4893  * self.use_same_sparsity = 0
4894  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
4895  * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t)) # <<<<<<<<<<<<<<
4896  * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
4897  *
4898  */
4899  __pyx_t_4 = __Pyx_PyInt_FromSize_t((sizeof(__pyx_t_5numpy_int32_t))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error)
4900  __Pyx_GOTREF(__pyx_t_4);
4901  __pyx_t_1 = PyNumber_Multiply(__pyx_v_dim, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
4902  __Pyx_GOTREF(__pyx_t_1);
4903  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4904  __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 190, __pyx_L1_error)
4905  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4906  __pyx_v_self->perm_r = ((int *)malloc(__pyx_t_5));
4907 
4908  /* "superluWrappers.pyx":191
4909  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
4910  * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t))
4911  * self.etree = <int *>malloc(dim*sizeof(np.int32_t)) # <<<<<<<<<<<<<<
4912  *
4913  * cdef _set_mat_types(self):
4914  */
4915  __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(__pyx_t_5numpy_int32_t))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
4916  __Pyx_GOTREF(__pyx_t_1);
4917  __pyx_t_4 = PyNumber_Multiply(__pyx_v_dim, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
4918  __Pyx_GOTREF(__pyx_t_4);
4919  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4920  __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 191, __pyx_L1_error)
4921  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4922  __pyx_v_self->etree = ((int *)malloc(__pyx_t_5));
4923 
4924  /* "superluWrappers.pyx":170
4925  * cdef public int dim
4926  *
4927  * def __init__(self, dim): # <<<<<<<<<<<<<<
4928  * """
4929  * Arguments
4930  */
4931 
4932  /* function exit code */
4933  __pyx_r = 0;
4934  goto __pyx_L0;
4935  __pyx_L1_error:;
4936  __Pyx_XDECREF(__pyx_t_1);
4937  __Pyx_XDECREF(__pyx_t_4);
4938  __Pyx_AddTraceback("superluWrappers.SparseFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4939  __pyx_r = -1;
4940  __pyx_L0:;
4941  __Pyx_RefNannyFinishContext();
4942  return __pyx_r;
4943 }
4944 
4945 /* "superluWrappers.pyx":193
4946  * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
4947  *
4948  * cdef _set_mat_types(self): # <<<<<<<<<<<<<<
4949  * self.A.Stype = _SLU_NC
4950  * self.A.Dtype = _SLU_D
4951  */
4952 
4953 static PyObject *__pyx_f_15superluWrappers_12SparseFactor__set_mat_types(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
4954  PyObject *__pyx_r = NULL;
4955  __Pyx_RefNannyDeclarations
4956  __Pyx_RefNannySetupContext("_set_mat_types", 0);
4957 
4958  /* "superluWrappers.pyx":194
4959  *
4960  * cdef _set_mat_types(self):
4961  * self.A.Stype = _SLU_NC # <<<<<<<<<<<<<<
4962  * self.A.Dtype = _SLU_D
4963  * self.A.Mtype = _SLU_GE
4964  */
4965  __pyx_v_self->A.Stype = SLU_NC;
4966 
4967  /* "superluWrappers.pyx":195
4968  * cdef _set_mat_types(self):
4969  * self.A.Stype = _SLU_NC
4970  * self.A.Dtype = _SLU_D # <<<<<<<<<<<<<<
4971  * self.A.Mtype = _SLU_GE
4972  * self.A.Store = &self.storeA
4973  */
4974  __pyx_v_self->A.Dtype = SLU_D;
4975 
4976  /* "superluWrappers.pyx":196
4977  * self.A.Stype = _SLU_NC
4978  * self.A.Dtype = _SLU_D
4979  * self.A.Mtype = _SLU_GE # <<<<<<<<<<<<<<
4980  * self.A.Store = &self.storeA
4981  *
4982  */
4983  __pyx_v_self->A.Mtype = SLU_GE;
4984 
4985  /* "superluWrappers.pyx":197
4986  * self.A.Dtype = _SLU_D
4987  * self.A.Mtype = _SLU_GE
4988  * self.A.Store = &self.storeA # <<<<<<<<<<<<<<
4989  *
4990  * self.AC.Stype = _SLU_NCP
4991  */
4992  __pyx_v_self->A.Store = (&__pyx_v_self->storeA);
4993 
4994  /* "superluWrappers.pyx":199
4995  * self.A.Store = &self.storeA
4996  *
4997  * self.AC.Stype = _SLU_NCP # <<<<<<<<<<<<<<
4998  * self.AC.Dtype = _SLU_D
4999  * self.AC.Mtype = _SLU_GE
5000  */
5001  __pyx_v_self->AC.Stype = SLU_NCP;
5002 
5003  /* "superluWrappers.pyx":200
5004  *
5005  * self.AC.Stype = _SLU_NCP
5006  * self.AC.Dtype = _SLU_D # <<<<<<<<<<<<<<
5007  * self.AC.Mtype = _SLU_GE
5008  * self.AC.Store = NULL
5009  */
5010  __pyx_v_self->AC.Dtype = SLU_D;
5011 
5012  /* "superluWrappers.pyx":201
5013  * self.AC.Stype = _SLU_NCP
5014  * self.AC.Dtype = _SLU_D
5015  * self.AC.Mtype = _SLU_GE # <<<<<<<<<<<<<<
5016  * self.AC.Store = NULL
5017  *
5018  */
5019  __pyx_v_self->AC.Mtype = SLU_GE;
5020 
5021  /* "superluWrappers.pyx":202
5022  * self.AC.Dtype = _SLU_D
5023  * self.AC.Mtype = _SLU_GE
5024  * self.AC.Store = NULL # <<<<<<<<<<<<<<
5025  *
5026  * self.L.Stype = _SLU_NC
5027  */
5028  __pyx_v_self->AC.Store = NULL;
5029 
5030  /* "superluWrappers.pyx":204
5031  * self.AC.Store = NULL
5032  *
5033  * self.L.Stype = _SLU_NC # <<<<<<<<<<<<<<
5034  * self.L.Dtype = _SLU_D
5035  * self.L.Mtype = _SLU_TRLU
5036  */
5037  __pyx_v_self->L.Stype = SLU_NC;
5038 
5039  /* "superluWrappers.pyx":205
5040  *
5041  * self.L.Stype = _SLU_NC
5042  * self.L.Dtype = _SLU_D # <<<<<<<<<<<<<<
5043  * self.L.Mtype = _SLU_TRLU
5044  * self.L.Store = NULL
5045  */
5046  __pyx_v_self->L.Dtype = SLU_D;
5047 
5048  /* "superluWrappers.pyx":206
5049  * self.L.Stype = _SLU_NC
5050  * self.L.Dtype = _SLU_D
5051  * self.L.Mtype = _SLU_TRLU # <<<<<<<<<<<<<<
5052  * self.L.Store = NULL
5053  *
5054  */
5055  __pyx_v_self->L.Mtype = SLU_TRLU;
5056 
5057  /* "superluWrappers.pyx":207
5058  * self.L.Dtype = _SLU_D
5059  * self.L.Mtype = _SLU_TRLU
5060  * self.L.Store = NULL # <<<<<<<<<<<<<<
5061  *
5062  * self.U.Stype = _SLU_NC
5063  */
5064  __pyx_v_self->L.Store = NULL;
5065 
5066  /* "superluWrappers.pyx":209
5067  * self.L.Store = NULL
5068  *
5069  * self.U.Stype = _SLU_NC # <<<<<<<<<<<<<<
5070  * self.U.Dtype = _SLU_D
5071  * self.U.Mtype = _SLU_TRU
5072  */
5073  __pyx_v_self->U.Stype = SLU_NC;
5074 
5075  /* "superluWrappers.pyx":210
5076  *
5077  * self.U.Stype = _SLU_NC
5078  * self.U.Dtype = _SLU_D # <<<<<<<<<<<<<<
5079  * self.U.Mtype = _SLU_TRU
5080  * self.U.Store = NULL
5081  */
5082  __pyx_v_self->U.Dtype = SLU_D;
5083 
5084  /* "superluWrappers.pyx":211
5085  * self.U.Stype = _SLU_NC
5086  * self.U.Dtype = _SLU_D
5087  * self.U.Mtype = _SLU_TRU # <<<<<<<<<<<<<<
5088  * self.U.Store = NULL
5089  *
5090  */
5091  __pyx_v_self->U.Mtype = SLU_TRU;
5092 
5093  /* "superluWrappers.pyx":212
5094  * self.U.Dtype = _SLU_D
5095  * self.U.Mtype = _SLU_TRU
5096  * self.U.Store = NULL # <<<<<<<<<<<<<<
5097  *
5098  * self.X.Stype = _SLU_DN
5099  */
5100  __pyx_v_self->U.Store = NULL;
5101 
5102  /* "superluWrappers.pyx":214
5103  * self.U.Store = NULL
5104  *
5105  * self.X.Stype = _SLU_DN # <<<<<<<<<<<<<<
5106  * self.X.Dtype = _SLU_D
5107  * self.X.Mtype = _SLU_GE
5108  */
5109  __pyx_v_self->X.Stype = SLU_DN;
5110 
5111  /* "superluWrappers.pyx":215
5112  *
5113  * self.X.Stype = _SLU_DN
5114  * self.X.Dtype = _SLU_D # <<<<<<<<<<<<<<
5115  * self.X.Mtype = _SLU_GE
5116  * self.X.Store = &self.storeX
5117  */
5118  __pyx_v_self->X.Dtype = SLU_D;
5119 
5120  /* "superluWrappers.pyx":216
5121  * self.X.Stype = _SLU_DN
5122  * self.X.Dtype = _SLU_D
5123  * self.X.Mtype = _SLU_GE # <<<<<<<<<<<<<<
5124  * self.X.Store = &self.storeX
5125  *
5126  */
5127  __pyx_v_self->X.Mtype = SLU_GE;
5128 
5129  /* "superluWrappers.pyx":217
5130  * self.X.Dtype = _SLU_D
5131  * self.X.Mtype = _SLU_GE
5132  * self.X.Store = &self.storeX # <<<<<<<<<<<<<<
5133  *
5134  * def sparseFactorPrepare(sparse_matrix,
5135  */
5136  __pyx_v_self->X.Store = (&__pyx_v_self->storeX);
5137 
5138  /* "superluWrappers.pyx":193
5139  * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
5140  *
5141  * cdef _set_mat_types(self): # <<<<<<<<<<<<<<
5142  * self.A.Stype = _SLU_NC
5143  * self.A.Dtype = _SLU_D
5144  */
5145 
5146  /* function exit code */
5147  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5148  __Pyx_XGIVEREF(__pyx_r);
5149  __Pyx_RefNannyFinishContext();
5150  return __pyx_r;
5151 }
5152 
5153 /* "superluWrappers.pyx":168
5154  * cdef unsigned int use_same_sparsity
5155  *
5156  * cdef public int dim # <<<<<<<<<<<<<<
5157  *
5158  * def __init__(self, dim):
5159  */
5160 
5161 /* Python wrapper */
5162 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(PyObject *__pyx_v_self); /*proto*/
5163 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(PyObject *__pyx_v_self) {
5164  PyObject *__pyx_r = 0;
5165  __Pyx_RefNannyDeclarations
5166  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5167  __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self));
5168 
5169  /* function exit code */
5170  __Pyx_RefNannyFinishContext();
5171  return __pyx_r;
5172 }
5173 
5174 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
5175  PyObject *__pyx_r = NULL;
5176  __Pyx_RefNannyDeclarations
5177  PyObject *__pyx_t_1 = NULL;
5178  int __pyx_lineno = 0;
5179  const char *__pyx_filename = NULL;
5180  int __pyx_clineno = 0;
5181  __Pyx_RefNannySetupContext("__get__", 0);
5182  __Pyx_XDECREF(__pyx_r);
5183  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
5184  __Pyx_GOTREF(__pyx_t_1);
5185  __pyx_r = __pyx_t_1;
5186  __pyx_t_1 = 0;
5187  goto __pyx_L0;
5188 
5189  /* function exit code */
5190  __pyx_L1_error:;
5191  __Pyx_XDECREF(__pyx_t_1);
5192  __Pyx_AddTraceback("superluWrappers.SparseFactor.dim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5193  __pyx_r = NULL;
5194  __pyx_L0:;
5195  __Pyx_XGIVEREF(__pyx_r);
5196  __Pyx_RefNannyFinishContext();
5197  return __pyx_r;
5198 }
5199 
5200 /* Python wrapper */
5201 static int __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
5202 static int __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
5203  int __pyx_r;
5204  __Pyx_RefNannyDeclarations
5205  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
5206  __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), ((PyObject *)__pyx_v_value));
5207 
5208  /* function exit code */
5209  __Pyx_RefNannyFinishContext();
5210  return __pyx_r;
5211 }
5212 
5213 static int __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_value) {
5214  int __pyx_r;
5215  __Pyx_RefNannyDeclarations
5216  int __pyx_t_1;
5217  int __pyx_lineno = 0;
5218  const char *__pyx_filename = NULL;
5219  int __pyx_clineno = 0;
5220  __Pyx_RefNannySetupContext("__set__", 0);
5221  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L1_error)
5222  __pyx_v_self->dim = __pyx_t_1;
5223 
5224  /* function exit code */
5225  __pyx_r = 0;
5226  goto __pyx_L0;
5227  __pyx_L1_error:;
5228  __Pyx_AddTraceback("superluWrappers.SparseFactor.dim.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5229  __pyx_r = -1;
5230  __pyx_L0:;
5231  __Pyx_RefNannyFinishContext();
5232  return __pyx_r;
5233 }
5234 
5235 /* "(tree fragment)":1
5236  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5237  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5238  * def __setstate_cython__(self, __pyx_state):
5239  */
5240 
5241 /* Python wrapper */
5242 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
5243 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5244  PyObject *__pyx_r = 0;
5245  __Pyx_RefNannyDeclarations
5246  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
5247  __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self));
5248 
5249  /* function exit code */
5250  __Pyx_RefNannyFinishContext();
5251  return __pyx_r;
5252 }
5253 
5254 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
5255  PyObject *__pyx_r = NULL;
5256  __Pyx_RefNannyDeclarations
5257  PyObject *__pyx_t_1 = NULL;
5258  int __pyx_lineno = 0;
5259  const char *__pyx_filename = NULL;
5260  int __pyx_clineno = 0;
5261  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
5262 
5263  /* "(tree fragment)":2
5264  * def __reduce_cython__(self):
5265  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
5266  * def __setstate_cython__(self, __pyx_state):
5267  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5268  */
5269  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
5270  __Pyx_GOTREF(__pyx_t_1);
5271  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5272  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5273  __PYX_ERR(1, 2, __pyx_L1_error)
5274 
5275  /* "(tree fragment)":1
5276  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5277  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5278  * def __setstate_cython__(self, __pyx_state):
5279  */
5280 
5281  /* function exit code */
5282  __pyx_L1_error:;
5283  __Pyx_XDECREF(__pyx_t_1);
5284  __Pyx_AddTraceback("superluWrappers.SparseFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5285  __pyx_r = NULL;
5286  __Pyx_XGIVEREF(__pyx_r);
5287  __Pyx_RefNannyFinishContext();
5288  return __pyx_r;
5289 }
5290 
5291 /* "(tree fragment)":3
5292  * def __reduce_cython__(self):
5293  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5294  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5295  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5296  */
5297 
5298 /* Python wrapper */
5299 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
5300 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5301  PyObject *__pyx_r = 0;
5302  __Pyx_RefNannyDeclarations
5303  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
5304  __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5305 
5306  /* function exit code */
5307  __Pyx_RefNannyFinishContext();
5308  return __pyx_r;
5309 }
5310 
5311 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
5312  PyObject *__pyx_r = NULL;
5313  __Pyx_RefNannyDeclarations
5314  PyObject *__pyx_t_1 = NULL;
5315  int __pyx_lineno = 0;
5316  const char *__pyx_filename = NULL;
5317  int __pyx_clineno = 0;
5318  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
5319 
5320  /* "(tree fragment)":4
5321  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5322  * def __setstate_cython__(self, __pyx_state):
5323  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
5324  */
5325  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
5326  __Pyx_GOTREF(__pyx_t_1);
5327  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5328  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5329  __PYX_ERR(1, 4, __pyx_L1_error)
5330 
5331  /* "(tree fragment)":3
5332  * def __reduce_cython__(self):
5333  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5334  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5335  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5336  */
5337 
5338  /* function exit code */
5339  __pyx_L1_error:;
5340  __Pyx_XDECREF(__pyx_t_1);
5341  __Pyx_AddTraceback("superluWrappers.SparseFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5342  __pyx_r = NULL;
5343  __Pyx_XGIVEREF(__pyx_r);
5344  __Pyx_RefNannyFinishContext();
5345  return __pyx_r;
5346 }
5347 
5348 /* "superluWrappers.pyx":219
5349  * self.X.Store = &self.storeX
5350  *
5351  * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
5352  * sparseFactor):
5353  * """ Python wrapper for superlu Sparse Factor Prepare function.
5354  */
5355 
5356 /* Python wrapper */
5357 static PyObject *__pyx_pw_15superluWrappers_1sparseFactorPrepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5358 static char __pyx_doc_15superluWrappers_sparseFactorPrepare[] = " Python wrapper for superlu Sparse Factor Prepare function.\n\n Arguments\n ---------\n sparse_matrix : superluWrappers.SparseMatrix\n sparseFactor: superluWrappers.SparseFactor\n\n ";
5359 static PyMethodDef __pyx_mdef_15superluWrappers_1sparseFactorPrepare = {"sparseFactorPrepare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_1sparseFactorPrepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_sparseFactorPrepare};
5360 static PyObject *__pyx_pw_15superluWrappers_1sparseFactorPrepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5361  PyObject *__pyx_v_sparse_matrix = 0;
5362  PyObject *__pyx_v_sparseFactor = 0;
5363  int __pyx_lineno = 0;
5364  const char *__pyx_filename = NULL;
5365  int __pyx_clineno = 0;
5366  PyObject *__pyx_r = 0;
5367  __Pyx_RefNannyDeclarations
5368  __Pyx_RefNannySetupContext("sparseFactorPrepare (wrapper)", 0);
5369  {
5370  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sparse_matrix,&__pyx_n_s_sparseFactor,0};
5371  PyObject* values[2] = {0,0};
5372  if (unlikely(__pyx_kwds)) {
5373  Py_ssize_t kw_args;
5374  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5375  switch (pos_args) {
5376  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5377  CYTHON_FALLTHROUGH;
5378  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5379  CYTHON_FALLTHROUGH;
5380  case 0: break;
5381  default: goto __pyx_L5_argtuple_error;
5382  }
5383  kw_args = PyDict_Size(__pyx_kwds);
5384  switch (pos_args) {
5385  case 0:
5386  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sparse_matrix)) != 0)) kw_args--;
5387  else goto __pyx_L5_argtuple_error;
5388  CYTHON_FALLTHROUGH;
5389  case 1:
5390  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sparseFactor)) != 0)) kw_args--;
5391  else {
5392  __Pyx_RaiseArgtupleInvalid("sparseFactorPrepare", 1, 2, 2, 1); __PYX_ERR(0, 219, __pyx_L3_error)
5393  }
5394  }
5395  if (unlikely(kw_args > 0)) {
5396  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparseFactorPrepare") < 0)) __PYX_ERR(0, 219, __pyx_L3_error)
5397  }
5398  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5399  goto __pyx_L5_argtuple_error;
5400  } else {
5401  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5402  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5403  }
5404  __pyx_v_sparse_matrix = values[0];
5405  __pyx_v_sparseFactor = values[1];
5406  }
5407  goto __pyx_L4_argument_unpacking_done;
5408  __pyx_L5_argtuple_error:;
5409  __Pyx_RaiseArgtupleInvalid("sparseFactorPrepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 219, __pyx_L3_error)
5410  __pyx_L3_error:;
5411  __Pyx_AddTraceback("superluWrappers.sparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5412  __Pyx_RefNannyFinishContext();
5413  return NULL;
5414  __pyx_L4_argument_unpacking_done:;
5415  __pyx_r = __pyx_pf_15superluWrappers_sparseFactorPrepare(__pyx_self, __pyx_v_sparse_matrix, __pyx_v_sparseFactor);
5416 
5417  /* function exit code */
5418  __Pyx_RefNannyFinishContext();
5419  return __pyx_r;
5420 }
5421 
5422 static PyObject *__pyx_pf_15superluWrappers_sparseFactorPrepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparse_matrix, PyObject *__pyx_v_sparseFactor) {
5423  PyObject *__pyx_r = NULL;
5424  __Pyx_RefNannyDeclarations
5425  PyObject *__pyx_t_1 = NULL;
5426  int __pyx_lineno = 0;
5427  const char *__pyx_filename = NULL;
5428  int __pyx_clineno = 0;
5429  __Pyx_RefNannySetupContext("sparseFactorPrepare", 0);
5430 
5431  /* "superluWrappers.pyx":229
5432  *
5433  * """
5434  * superluWrappersSparseFactorPrepare(sparse_matrix._cSparseMatrix, # <<<<<<<<<<<<<<
5435  * sparseFactor)
5436  *
5437  */
5438  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sparse_matrix, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
5439  __Pyx_GOTREF(__pyx_t_1);
5440  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 229, __pyx_L1_error)
5441 
5442  /* "superluWrappers.pyx":230
5443  * """
5444  * superluWrappersSparseFactorPrepare(sparse_matrix._cSparseMatrix,
5445  * sparseFactor) # <<<<<<<<<<<<<<
5446  *
5447  * cdef void superluWrappersSparseFactorPrepare(cSparseMatrix sm,
5448  */
5449  if (!(likely(((__pyx_v_sparseFactor) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_sparseFactor, __pyx_ptype_15superluWrappers_SparseFactor))))) __PYX_ERR(0, 230, __pyx_L1_error)
5450 
5451  /* "superluWrappers.pyx":229
5452  *
5453  * """
5454  * superluWrappersSparseFactorPrepare(sparse_matrix._cSparseMatrix, # <<<<<<<<<<<<<<
5455  * sparseFactor)
5456  *
5457  */
5458  __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_sparseFactor));
5459  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5460 
5461  /* "superluWrappers.pyx":219
5462  * self.X.Store = &self.storeX
5463  *
5464  * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
5465  * sparseFactor):
5466  * """ Python wrapper for superlu Sparse Factor Prepare function.
5467  */
5468 
5469  /* function exit code */
5470  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5471  goto __pyx_L0;
5472  __pyx_L1_error:;
5473  __Pyx_XDECREF(__pyx_t_1);
5474  __Pyx_AddTraceback("superluWrappers.sparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5475  __pyx_r = NULL;
5476  __pyx_L0:;
5477  __Pyx_XGIVEREF(__pyx_r);
5478  __Pyx_RefNannyFinishContext();
5479  return __pyx_r;
5480 }
5481 
5482 /* "superluWrappers.pyx":232
5483  * sparseFactor)
5484  *
5485  * cdef void superluWrappersSparseFactorPrepare(cSparseMatrix sm, # <<<<<<<<<<<<<<
5486  * SparseFactor sparseFactor):
5487  *
5488  */
5489 
5490 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_sm, struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_sparseFactor) {
5491  int __pyx_v_permc_spec;
5492  int __pyx_v_n;
5493  int __pyx_v_relax;
5494  int __pyx_v_panel_size;
5495  int __pyx_v_lwork;
5496  int __pyx_v_info;
5497  void *__pyx_v_work;
5498  PyObject *__pyx_v_i = NULL;
5499  __Pyx_RefNannyDeclarations
5500  __pyx_t_5numpy_int32_t __pyx_t_1;
5501  int __pyx_t_2;
5502  int __pyx_t_3;
5503  PyObject *__pyx_t_4 = NULL;
5504  PyObject *__pyx_t_5 = NULL;
5505  Py_ssize_t __pyx_t_6;
5506  PyObject *(*__pyx_t_7)(PyObject *);
5507  Py_ssize_t __pyx_t_8;
5508  Py_ssize_t __pyx_t_9;
5509  int __pyx_lineno = 0;
5510  const char *__pyx_filename = NULL;
5511  int __pyx_clineno = 0;
5512  __Pyx_RefNannySetupContext("superluWrappersSparseFactorPrepare", 0);
5513 
5514  /* "superluWrappers.pyx":235
5515  * SparseFactor sparseFactor):
5516  *
5517  * cdef int permc_spec = 3 # <<<<<<<<<<<<<<
5518  * cdef int n
5519  * cdef int relax=1
5520  */
5521  __pyx_v_permc_spec = 3;
5522 
5523  /* "superluWrappers.pyx":237
5524  * cdef int permc_spec = 3
5525  * cdef int n
5526  * cdef int relax=1 # <<<<<<<<<<<<<<
5527  * cdef int panel_size = 10
5528  * cdef int lwork = 0
5529  */
5530  __pyx_v_relax = 1;
5531 
5532  /* "superluWrappers.pyx":238
5533  * cdef int n
5534  * cdef int relax=1
5535  * cdef int panel_size = 10 # <<<<<<<<<<<<<<
5536  * cdef int lwork = 0
5537  * cdef int info = 0
5538  */
5539  __pyx_v_panel_size = 10;
5540 
5541  /* "superluWrappers.pyx":239
5542  * cdef int relax=1
5543  * cdef int panel_size = 10
5544  * cdef int lwork = 0 # <<<<<<<<<<<<<<
5545  * cdef int info = 0
5546  * cdef void *work = NULL
5547  */
5548  __pyx_v_lwork = 0;
5549 
5550  /* "superluWrappers.pyx":240
5551  * cdef int panel_size = 10
5552  * cdef int lwork = 0
5553  * cdef int info = 0 # <<<<<<<<<<<<<<
5554  * cdef void *work = NULL
5555  *
5556  */
5557  __pyx_v_info = 0;
5558 
5559  /* "superluWrappers.pyx":241
5560  * cdef int lwork = 0
5561  * cdef int info = 0
5562  * cdef void *work = NULL # <<<<<<<<<<<<<<
5563  *
5564  * sparseFactor.storeA.nnz = sm.A.nnz
5565  */
5566  __pyx_v_work = NULL;
5567 
5568  /* "superluWrappers.pyx":243
5569  * cdef void *work = NULL
5570  *
5571  * sparseFactor.storeA.nnz = sm.A.nnz # <<<<<<<<<<<<<<
5572  * sparseFactor.storeA.nzval = &sm.A.nzval[0]
5573  * sparseFactor.storeA.colptr = &sm.A.rowptr[0]
5574  */
5575  __pyx_t_1 = __pyx_v_sm->A.nnz;
5576  __pyx_v_sparseFactor->storeA.nnz = __pyx_t_1;
5577 
5578  /* "superluWrappers.pyx":244
5579  *
5580  * sparseFactor.storeA.nnz = sm.A.nnz
5581  * sparseFactor.storeA.nzval = &sm.A.nzval[0] # <<<<<<<<<<<<<<
5582  * sparseFactor.storeA.colptr = &sm.A.rowptr[0]
5583  * sparseFactor.storeA.rowind = &sm.A.colind[0]
5584  */
5585  __pyx_v_sparseFactor->storeA.nzval = (&(__pyx_v_sm->A.nzval[0]));
5586 
5587  /* "superluWrappers.pyx":245
5588  * sparseFactor.storeA.nnz = sm.A.nnz
5589  * sparseFactor.storeA.nzval = &sm.A.nzval[0]
5590  * sparseFactor.storeA.colptr = &sm.A.rowptr[0] # <<<<<<<<<<<<<<
5591  * sparseFactor.storeA.rowind = &sm.A.colind[0]
5592  *
5593  */
5594  __pyx_v_sparseFactor->storeA.colptr = (&(__pyx_v_sm->A.rowptr[0]));
5595 
5596  /* "superluWrappers.pyx":246
5597  * sparseFactor.storeA.nzval = &sm.A.nzval[0]
5598  * sparseFactor.storeA.colptr = &sm.A.rowptr[0]
5599  * sparseFactor.storeA.rowind = &sm.A.colind[0] # <<<<<<<<<<<<<<
5600  *
5601  * if sparseFactor.use_same_perm_c == 0:
5602  */
5603  __pyx_v_sparseFactor->storeA.rowind = (&(__pyx_v_sm->A.colind[0]));
5604 
5605  /* "superluWrappers.pyx":248
5606  * sparseFactor.storeA.rowind = &sm.A.colind[0]
5607  *
5608  * if sparseFactor.use_same_perm_c == 0: # <<<<<<<<<<<<<<
5609  * cget_perm_c(permc_spec,
5610  * &sparseFactor.A,
5611  */
5612  __pyx_t_2 = ((__pyx_v_sparseFactor->use_same_perm_c == 0) != 0);
5613  if (__pyx_t_2) {
5614 
5615  /* "superluWrappers.pyx":249
5616  *
5617  * if sparseFactor.use_same_perm_c == 0:
5618  * cget_perm_c(permc_spec, # <<<<<<<<<<<<<<
5619  * &sparseFactor.A,
5620  * sparseFactor.perm_c)
5621  */
5622  get_perm_c(__pyx_v_permc_spec, (&__pyx_v_sparseFactor->A), __pyx_v_sparseFactor->perm_c);
5623 
5624  /* "superluWrappers.pyx":252
5625  * &sparseFactor.A,
5626  * sparseFactor.perm_c)
5627  * sparseFactor.use_same_perm_c = 1 # <<<<<<<<<<<<<<
5628  *
5629  * if sparseFactor.use_same_sparsity == 0:
5630  */
5631  __pyx_v_sparseFactor->use_same_perm_c = 1;
5632 
5633  /* "superluWrappers.pyx":248
5634  * sparseFactor.storeA.rowind = &sm.A.colind[0]
5635  *
5636  * if sparseFactor.use_same_perm_c == 0: # <<<<<<<<<<<<<<
5637  * cget_perm_c(permc_spec,
5638  * &sparseFactor.A,
5639  */
5640  }
5641 
5642  /* "superluWrappers.pyx":254
5643  * sparseFactor.use_same_perm_c = 1
5644  *
5645  * if sparseFactor.use_same_sparsity == 0: # <<<<<<<<<<<<<<
5646  * if sparseFactor.AC.Store != NULL:
5647  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5648  */
5649  __pyx_t_2 = ((__pyx_v_sparseFactor->use_same_sparsity == 0) != 0);
5650  if (__pyx_t_2) {
5651 
5652  /* "superluWrappers.pyx":255
5653  *
5654  * if sparseFactor.use_same_sparsity == 0:
5655  * if sparseFactor.AC.Store != NULL: # <<<<<<<<<<<<<<
5656  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5657  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5658  */
5659  __pyx_t_2 = ((__pyx_v_sparseFactor->AC.Store != NULL) != 0);
5660  if (__pyx_t_2) {
5661 
5662  /* "superluWrappers.pyx":256
5663  * if sparseFactor.use_same_sparsity == 0:
5664  * if sparseFactor.AC.Store != NULL:
5665  * cDestroy_CompCol_Permuted(&sparseFactor.AC) # <<<<<<<<<<<<<<
5666  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5667  * cDestroy_CompCol_Matrix(&sparseFactor.U)
5668  */
5669  Destroy_CompCol_Permuted((&__pyx_v_sparseFactor->AC));
5670 
5671  /* "superluWrappers.pyx":257
5672  * if sparseFactor.AC.Store != NULL:
5673  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5674  * cDestroy_SuperNode_Matrix(&sparseFactor.L) # <<<<<<<<<<<<<<
5675  * cDestroy_CompCol_Matrix(&sparseFactor.U)
5676  * csp_preorder(&sparseFactor.options,
5677  */
5678  Destroy_SuperNode_Matrix((&__pyx_v_sparseFactor->L));
5679 
5680  /* "superluWrappers.pyx":258
5681  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5682  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5683  * cDestroy_CompCol_Matrix(&sparseFactor.U) # <<<<<<<<<<<<<<
5684  * csp_preorder(&sparseFactor.options,
5685  * &sparseFactor.A,
5686  */
5687  Destroy_CompCol_Matrix((&__pyx_v_sparseFactor->U));
5688 
5689  /* "superluWrappers.pyx":255
5690  *
5691  * if sparseFactor.use_same_sparsity == 0:
5692  * if sparseFactor.AC.Store != NULL: # <<<<<<<<<<<<<<
5693  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5694  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5695  */
5696  }
5697 
5698  /* "superluWrappers.pyx":259
5699  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5700  * cDestroy_CompCol_Matrix(&sparseFactor.U)
5701  * csp_preorder(&sparseFactor.options, # <<<<<<<<<<<<<<
5702  * &sparseFactor.A,
5703  * sparseFactor.perm_c,
5704  */
5705  sp_preorder((&__pyx_v_sparseFactor->options), (&__pyx_v_sparseFactor->A), __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->etree, (&__pyx_v_sparseFactor->AC));
5706 
5707  /* "superluWrappers.pyx":264
5708  * sparseFactor.etree,
5709  * &sparseFactor.AC)
5710  * sparseFactor.use_same_sparsity = 1 # <<<<<<<<<<<<<<
5711  * else:
5712  * sparseFactor.options.Fact = _SamePattern_SameRowPerm
5713  */
5714  __pyx_v_sparseFactor->use_same_sparsity = 1;
5715 
5716  /* "superluWrappers.pyx":254
5717  * sparseFactor.use_same_perm_c = 1
5718  *
5719  * if sparseFactor.use_same_sparsity == 0: # <<<<<<<<<<<<<<
5720  * if sparseFactor.AC.Store != NULL:
5721  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5722  */
5723  goto __pyx_L4;
5724  }
5725 
5726  /* "superluWrappers.pyx":266
5727  * sparseFactor.use_same_sparsity = 1
5728  * else:
5729  * sparseFactor.options.Fact = _SamePattern_SameRowPerm # <<<<<<<<<<<<<<
5730  * n = sparseFactor.A.ncol
5731  * for i in range(n):
5732  */
5733  /*else*/ {
5734  __pyx_v_sparseFactor->options.Fact = SamePattern_SameRowPerm;
5735 
5736  /* "superluWrappers.pyx":267
5737  * else:
5738  * sparseFactor.options.Fact = _SamePattern_SameRowPerm
5739  * n = sparseFactor.A.ncol # <<<<<<<<<<<<<<
5740  * for i in range(n):
5741  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5742  */
5743  __pyx_t_3 = __pyx_v_sparseFactor->A.ncol;
5744  __pyx_v_n = __pyx_t_3;
5745 
5746  /* "superluWrappers.pyx":268
5747  * sparseFactor.options.Fact = _SamePattern_SameRowPerm
5748  * n = sparseFactor.A.ncol
5749  * for i in range(n): # <<<<<<<<<<<<<<
5750  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5751  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
5752  */
5753  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
5754  __Pyx_GOTREF(__pyx_t_4);
5755  __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
5756  __Pyx_GOTREF(__pyx_t_5);
5757  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5758  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
5759  __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
5760  __pyx_t_7 = NULL;
5761  } else {
5762  __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
5763  __Pyx_GOTREF(__pyx_t_4);
5764  __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 268, __pyx_L1_error)
5765  }
5766  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5767  for (;;) {
5768  if (likely(!__pyx_t_7)) {
5769  if (likely(PyList_CheckExact(__pyx_t_4))) {
5770  if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
5771  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5772  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
5773  #else
5774  __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
5775  __Pyx_GOTREF(__pyx_t_5);
5776  #endif
5777  } else {
5778  if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
5779  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5780  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
5781  #else
5782  __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
5783  __Pyx_GOTREF(__pyx_t_5);
5784  #endif
5785  }
5786  } else {
5787  __pyx_t_5 = __pyx_t_7(__pyx_t_4);
5788  if (unlikely(!__pyx_t_5)) {
5789  PyObject* exc_type = PyErr_Occurred();
5790  if (exc_type) {
5791  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5792  else __PYX_ERR(0, 268, __pyx_L1_error)
5793  }
5794  break;
5795  }
5796  __Pyx_GOTREF(__pyx_t_5);
5797  }
5798  __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
5799  __pyx_t_5 = 0;
5800 
5801  /* "superluWrappers.pyx":269
5802  * n = sparseFactor.A.ncol
5803  * for i in range(n):
5804  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i] # <<<<<<<<<<<<<<
5805  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
5806  * cdgstrf(&sparseFactor.options,
5807  */
5808  __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
5809  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
5810  (((struct __pyx_t_15superluWrappers__NCPformat *)__pyx_v_sparseFactor->AC.Store)->colbeg[(__pyx_v_sparseFactor->perm_c[__pyx_t_9])]) = (((struct __pyx_t_15superluWrappers__NCformat *)__pyx_v_sparseFactor->A.Store)->colptr[__pyx_t_8]);
5811 
5812  /* "superluWrappers.pyx":270
5813  * for i in range(n):
5814  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5815  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1] # <<<<<<<<<<<<<<
5816  * cdgstrf(&sparseFactor.options,
5817  * &sparseFactor.AC,
5818  */
5819  __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 270, __pyx_L1_error)
5820  __Pyx_GOTREF(__pyx_t_5);
5821  __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error)
5822  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5823  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error)
5824  (((struct __pyx_t_15superluWrappers__NCPformat *)__pyx_v_sparseFactor->AC.Store)->colend[(__pyx_v_sparseFactor->perm_c[__pyx_t_9])]) = (((struct __pyx_t_15superluWrappers__NCformat *)__pyx_v_sparseFactor->A.Store)->colptr[__pyx_t_8]);
5825 
5826  /* "superluWrappers.pyx":268
5827  * sparseFactor.options.Fact = _SamePattern_SameRowPerm
5828  * n = sparseFactor.A.ncol
5829  * for i in range(n): # <<<<<<<<<<<<<<
5830  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5831  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
5832  */
5833  }
5834  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5835  }
5836  __pyx_L4:;
5837 
5838  /* "superluWrappers.pyx":271
5839  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5840  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
5841  * cdgstrf(&sparseFactor.options, # <<<<<<<<<<<<<<
5842  * &sparseFactor.AC,
5843  * relax,
5844  */
5845  dgstrf((&__pyx_v_sparseFactor->options), (&__pyx_v_sparseFactor->AC), __pyx_v_relax, __pyx_v_panel_size, __pyx_v_sparseFactor->etree, __pyx_v_work, __pyx_v_lwork, __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->perm_r, (&__pyx_v_sparseFactor->L), (&__pyx_v_sparseFactor->U), (&__pyx_v_sparseFactor->Glu), (&__pyx_v_sparseFactor->stat), (&__pyx_v_info));
5846 
5847  /* "superluWrappers.pyx":232
5848  * sparseFactor)
5849  *
5850  * cdef void superluWrappersSparseFactorPrepare(cSparseMatrix sm, # <<<<<<<<<<<<<<
5851  * SparseFactor sparseFactor):
5852  *
5853  */
5854 
5855  /* function exit code */
5856  goto __pyx_L0;
5857  __pyx_L1_error:;
5858  __Pyx_XDECREF(__pyx_t_4);
5859  __Pyx_XDECREF(__pyx_t_5);
5860  __Pyx_WriteUnraisable("superluWrappers.superluWrappersSparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5861  __pyx_L0:;
5862  __Pyx_XDECREF(__pyx_v_i);
5863  __Pyx_RefNannyFinishContext();
5864 }
5865 
5866 /* "superluWrappers.pyx":286
5867  * &info)
5868  *
5869  * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
5870  * x):
5871  * """ Sparse factor solve wrappers
5872  */
5873 
5874 /* Python wrapper */
5875 static PyObject *__pyx_pw_15superluWrappers_3sparseFactorSolve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5876 static char __pyx_doc_15superluWrappers_2sparseFactorSolve[] = " Sparse factor solve wrappers\n\n Arguments\n ---------\n sparseFactor : superluWrappers.SparseFactor\n x (input / output) : np.array\n x serves as the right hand side and then becomes the solution\n ";
5877 static PyMethodDef __pyx_mdef_15superluWrappers_3sparseFactorSolve = {"sparseFactorSolve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_3sparseFactorSolve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_2sparseFactorSolve};
5878 static PyObject *__pyx_pw_15superluWrappers_3sparseFactorSolve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5879  PyObject *__pyx_v_sparseFactor = 0;
5880  PyObject *__pyx_v_x = 0;
5881  int __pyx_lineno = 0;
5882  const char *__pyx_filename = NULL;
5883  int __pyx_clineno = 0;
5884  PyObject *__pyx_r = 0;
5885  __Pyx_RefNannyDeclarations
5886  __Pyx_RefNannySetupContext("sparseFactorSolve (wrapper)", 0);
5887  {
5888  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sparseFactor,&__pyx_n_s_x,0};
5889  PyObject* values[2] = {0,0};
5890  if (unlikely(__pyx_kwds)) {
5891  Py_ssize_t kw_args;
5892  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5893  switch (pos_args) {
5894  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5895  CYTHON_FALLTHROUGH;
5896  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5897  CYTHON_FALLTHROUGH;
5898  case 0: break;
5899  default: goto __pyx_L5_argtuple_error;
5900  }
5901  kw_args = PyDict_Size(__pyx_kwds);
5902  switch (pos_args) {
5903  case 0:
5904  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sparseFactor)) != 0)) kw_args--;
5905  else goto __pyx_L5_argtuple_error;
5906  CYTHON_FALLTHROUGH;
5907  case 1:
5908  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5909  else {
5910  __Pyx_RaiseArgtupleInvalid("sparseFactorSolve", 1, 2, 2, 1); __PYX_ERR(0, 286, __pyx_L3_error)
5911  }
5912  }
5913  if (unlikely(kw_args > 0)) {
5914  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparseFactorSolve") < 0)) __PYX_ERR(0, 286, __pyx_L3_error)
5915  }
5916  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5917  goto __pyx_L5_argtuple_error;
5918  } else {
5919  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5920  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5921  }
5922  __pyx_v_sparseFactor = values[0];
5923  __pyx_v_x = values[1];
5924  }
5925  goto __pyx_L4_argument_unpacking_done;
5926  __pyx_L5_argtuple_error:;
5927  __Pyx_RaiseArgtupleInvalid("sparseFactorSolve", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 286, __pyx_L3_error)
5928  __pyx_L3_error:;
5929  __Pyx_AddTraceback("superluWrappers.sparseFactorSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5930  __Pyx_RefNannyFinishContext();
5931  return NULL;
5932  __pyx_L4_argument_unpacking_done:;
5933  __pyx_r = __pyx_pf_15superluWrappers_2sparseFactorSolve(__pyx_self, __pyx_v_sparseFactor, __pyx_v_x);
5934 
5935  /* function exit code */
5936  __Pyx_RefNannyFinishContext();
5937  return __pyx_r;
5938 }
5939 
5940 static PyObject *__pyx_pf_15superluWrappers_2sparseFactorSolve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparseFactor, PyObject *__pyx_v_x) {
5941  PyObject *__pyx_r = NULL;
5942  __Pyx_RefNannyDeclarations
5943  __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
5944  int __pyx_lineno = 0;
5945  const char *__pyx_filename = NULL;
5946  int __pyx_clineno = 0;
5947  __Pyx_RefNannySetupContext("sparseFactorSolve", 0);
5948 
5949  /* "superluWrappers.pyx":296
5950  * x serves as the right hand side and then becomes the solution
5951  * """
5952  * superluWrappersSparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
5953  * x)
5954  *
5955  */
5956  if (!(likely(((__pyx_v_sparseFactor) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_sparseFactor, __pyx_ptype_15superluWrappers_SparseFactor))))) __PYX_ERR(0, 296, __pyx_L1_error)
5957 
5958  /* "superluWrappers.pyx":297
5959  * """
5960  * superluWrappersSparseFactorSolve(sparseFactor,
5961  * x) # <<<<<<<<<<<<<<
5962  *
5963  *
5964  */
5965  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_x, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 297, __pyx_L1_error)
5966 
5967  /* "superluWrappers.pyx":296
5968  * x serves as the right hand side and then becomes the solution
5969  * """
5970  * superluWrappersSparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
5971  * x)
5972  *
5973  */
5974  __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_sparseFactor), __pyx_t_1);
5975  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
5976  __pyx_t_1.memview = NULL;
5977  __pyx_t_1.data = NULL;
5978 
5979  /* "superluWrappers.pyx":286
5980  * &info)
5981  *
5982  * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
5983  * x):
5984  * """ Sparse factor solve wrappers
5985  */
5986 
5987  /* function exit code */
5988  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5989  goto __pyx_L0;
5990  __pyx_L1_error:;
5991  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
5992  __Pyx_AddTraceback("superluWrappers.sparseFactorSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5993  __pyx_r = NULL;
5994  __pyx_L0:;
5995  __Pyx_XGIVEREF(__pyx_r);
5996  __Pyx_RefNannyFinishContext();
5997  return __pyx_r;
5998 }
5999 
6000 /* "superluWrappers.pyx":300
6001  *
6002  *
6003  * cdef void superluWrappersSparseFactorSolve(SparseFactor sparseFactor, # <<<<<<<<<<<<<<
6004  * np.float64_t [:] x):
6005  * cdef _trans_t trans = _TRANS
6006  */
6007 
6008 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_sparseFactor, __Pyx_memviewslice __pyx_v_x) {
6009  trans_t __pyx_v_trans;
6010  int __pyx_v_info;
6011  __Pyx_RefNannyDeclarations
6012  Py_ssize_t __pyx_t_1;
6013  __Pyx_RefNannySetupContext("superluWrappersSparseFactorSolve", 0);
6014 
6015  /* "superluWrappers.pyx":302
6016  * cdef void superluWrappersSparseFactorSolve(SparseFactor sparseFactor,
6017  * np.float64_t [:] x):
6018  * cdef _trans_t trans = _TRANS # <<<<<<<<<<<<<<
6019  * cdef int info = 0
6020  *
6021  */
6022  __pyx_v_trans = TRANS;
6023 
6024  /* "superluWrappers.pyx":303
6025  * np.float64_t [:] x):
6026  * cdef _trans_t trans = _TRANS
6027  * cdef int info = 0 # <<<<<<<<<<<<<<
6028  *
6029  * sparseFactor.storeX.nzval = &x[0]
6030  */
6031  __pyx_v_info = 0;
6032 
6033  /* "superluWrappers.pyx":305
6034  * cdef int info = 0
6035  *
6036  * sparseFactor.storeX.nzval = &x[0] # <<<<<<<<<<<<<<
6037  *
6038  * cdgstrs(trans,
6039  */
6040  __pyx_t_1 = 0;
6041  __pyx_v_sparseFactor->storeX.nzval = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_1 * __pyx_v_x.strides[0]) ))));
6042 
6043  /* "superluWrappers.pyx":307
6044  * sparseFactor.storeX.nzval = &x[0]
6045  *
6046  * cdgstrs(trans, # <<<<<<<<<<<<<<
6047  * &sparseFactor.L,
6048  * &sparseFactor.U,
6049  */
6050  dgstrs(__pyx_v_trans, (&__pyx_v_sparseFactor->L), (&__pyx_v_sparseFactor->U), __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->perm_r, (&__pyx_v_sparseFactor->X), (&__pyx_v_sparseFactor->stat), (&__pyx_v_info));
6051 
6052  /* "superluWrappers.pyx":300
6053  *
6054  *
6055  * cdef void superluWrappersSparseFactorSolve(SparseFactor sparseFactor, # <<<<<<<<<<<<<<
6056  * np.float64_t [:] x):
6057  * cdef _trans_t trans = _TRANS
6058  */
6059 
6060  /* function exit code */
6061  __Pyx_RefNannyFinishContext();
6062 }
6063 
6064 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":742
6065  * ctypedef npy_cdouble complex_t
6066  *
6067  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6068  * return PyArray_MultiIterNew(1, <void*>a)
6069  *
6070  */
6071 
6072 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
6073  PyObject *__pyx_r = NULL;
6074  __Pyx_RefNannyDeclarations
6075  PyObject *__pyx_t_1 = NULL;
6076  int __pyx_lineno = 0;
6077  const char *__pyx_filename = NULL;
6078  int __pyx_clineno = 0;
6079  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
6080 
6081  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":743
6082  *
6083  * cdef inline object PyArray_MultiIterNew1(a):
6084  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
6085  *
6086  * cdef inline object PyArray_MultiIterNew2(a, b):
6087  */
6088  __Pyx_XDECREF(__pyx_r);
6089  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 743, __pyx_L1_error)
6090  __Pyx_GOTREF(__pyx_t_1);
6091  __pyx_r = __pyx_t_1;
6092  __pyx_t_1 = 0;
6093  goto __pyx_L0;
6094 
6095  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":742
6096  * ctypedef npy_cdouble complex_t
6097  *
6098  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6099  * return PyArray_MultiIterNew(1, <void*>a)
6100  *
6101  */
6102 
6103  /* function exit code */
6104  __pyx_L1_error:;
6105  __Pyx_XDECREF(__pyx_t_1);
6106  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
6107  __pyx_r = 0;
6108  __pyx_L0:;
6109  __Pyx_XGIVEREF(__pyx_r);
6110  __Pyx_RefNannyFinishContext();
6111  return __pyx_r;
6112 }
6113 
6114 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":745
6115  * return PyArray_MultiIterNew(1, <void*>a)
6116  *
6117  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6118  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6119  *
6120  */
6121 
6122 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
6123  PyObject *__pyx_r = NULL;
6124  __Pyx_RefNannyDeclarations
6125  PyObject *__pyx_t_1 = NULL;
6126  int __pyx_lineno = 0;
6127  const char *__pyx_filename = NULL;
6128  int __pyx_clineno = 0;
6129  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
6130 
6131  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":746
6132  *
6133  * cdef inline object PyArray_MultiIterNew2(a, b):
6134  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
6135  *
6136  * cdef inline object PyArray_MultiIterNew3(a, b, c):
6137  */
6138  __Pyx_XDECREF(__pyx_r);
6139  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 746, __pyx_L1_error)
6140  __Pyx_GOTREF(__pyx_t_1);
6141  __pyx_r = __pyx_t_1;
6142  __pyx_t_1 = 0;
6143  goto __pyx_L0;
6144 
6145  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":745
6146  * return PyArray_MultiIterNew(1, <void*>a)
6147  *
6148  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6149  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6150  *
6151  */
6152 
6153  /* function exit code */
6154  __pyx_L1_error:;
6155  __Pyx_XDECREF(__pyx_t_1);
6156  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
6157  __pyx_r = 0;
6158  __pyx_L0:;
6159  __Pyx_XGIVEREF(__pyx_r);
6160  __Pyx_RefNannyFinishContext();
6161  return __pyx_r;
6162 }
6163 
6164 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":748
6165  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6166  *
6167  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6168  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6169  *
6170  */
6171 
6172 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
6173  PyObject *__pyx_r = NULL;
6174  __Pyx_RefNannyDeclarations
6175  PyObject *__pyx_t_1 = NULL;
6176  int __pyx_lineno = 0;
6177  const char *__pyx_filename = NULL;
6178  int __pyx_clineno = 0;
6179  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
6180 
6181  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":749
6182  *
6183  * cdef inline object PyArray_MultiIterNew3(a, b, c):
6184  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
6185  *
6186  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6187  */
6188  __Pyx_XDECREF(__pyx_r);
6189  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 749, __pyx_L1_error)
6190  __Pyx_GOTREF(__pyx_t_1);
6191  __pyx_r = __pyx_t_1;
6192  __pyx_t_1 = 0;
6193  goto __pyx_L0;
6194 
6195  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":748
6196  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6197  *
6198  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6199  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6200  *
6201  */
6202 
6203  /* function exit code */
6204  __pyx_L1_error:;
6205  __Pyx_XDECREF(__pyx_t_1);
6206  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
6207  __pyx_r = 0;
6208  __pyx_L0:;
6209  __Pyx_XGIVEREF(__pyx_r);
6210  __Pyx_RefNannyFinishContext();
6211  return __pyx_r;
6212 }
6213 
6214 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":751
6215  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6216  *
6217  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6218  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6219  *
6220  */
6221 
6222 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
6223  PyObject *__pyx_r = NULL;
6224  __Pyx_RefNannyDeclarations
6225  PyObject *__pyx_t_1 = NULL;
6226  int __pyx_lineno = 0;
6227  const char *__pyx_filename = NULL;
6228  int __pyx_clineno = 0;
6229  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
6230 
6231  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":752
6232  *
6233  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6234  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
6235  *
6236  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
6237  */
6238  __Pyx_XDECREF(__pyx_r);
6239  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 752, __pyx_L1_error)
6240  __Pyx_GOTREF(__pyx_t_1);
6241  __pyx_r = __pyx_t_1;
6242  __pyx_t_1 = 0;
6243  goto __pyx_L0;
6244 
6245  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":751
6246  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6247  *
6248  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6249  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6250  *
6251  */
6252 
6253  /* function exit code */
6254  __pyx_L1_error:;
6255  __Pyx_XDECREF(__pyx_t_1);
6256  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
6257  __pyx_r = 0;
6258  __pyx_L0:;
6259  __Pyx_XGIVEREF(__pyx_r);
6260  __Pyx_RefNannyFinishContext();
6261  return __pyx_r;
6262 }
6263 
6264 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":754
6265  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6266  *
6267  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
6268  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6269  *
6270  */
6271 
6272 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
6273  PyObject *__pyx_r = NULL;
6274  __Pyx_RefNannyDeclarations
6275  PyObject *__pyx_t_1 = NULL;
6276  int __pyx_lineno = 0;
6277  const char *__pyx_filename = NULL;
6278  int __pyx_clineno = 0;
6279  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
6280 
6281  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":755
6282  *
6283  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
6284  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
6285  *
6286  * cdef inline tuple PyDataType_SHAPE(dtype d):
6287  */
6288  __Pyx_XDECREF(__pyx_r);
6289  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 755, __pyx_L1_error)
6290  __Pyx_GOTREF(__pyx_t_1);
6291  __pyx_r = __pyx_t_1;
6292  __pyx_t_1 = 0;
6293  goto __pyx_L0;
6294 
6295  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":754
6296  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6297  *
6298  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
6299  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6300  *
6301  */
6302 
6303  /* function exit code */
6304  __pyx_L1_error:;
6305  __Pyx_XDECREF(__pyx_t_1);
6306  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
6307  __pyx_r = 0;
6308  __pyx_L0:;
6309  __Pyx_XGIVEREF(__pyx_r);
6310  __Pyx_RefNannyFinishContext();
6311  return __pyx_r;
6312 }
6313 
6314 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":757
6315  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6316  *
6317  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
6318  * if PyDataType_HASSUBARRAY(d):
6319  * return <tuple>d.subarray.shape
6320  */
6321 
6322 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
6323  PyObject *__pyx_r = NULL;
6324  __Pyx_RefNannyDeclarations
6325  int __pyx_t_1;
6326  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
6327 
6328  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":758
6329  *
6330  * cdef inline tuple PyDataType_SHAPE(dtype d):
6331  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
6332  * return <tuple>d.subarray.shape
6333  * else:
6334  */
6335  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
6336  if (__pyx_t_1) {
6337 
6338  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":759
6339  * cdef inline tuple PyDataType_SHAPE(dtype d):
6340  * if PyDataType_HASSUBARRAY(d):
6341  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
6342  * else:
6343  * return ()
6344  */
6345  __Pyx_XDECREF(__pyx_r);
6346  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
6347  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
6348  goto __pyx_L0;
6349 
6350  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":758
6351  *
6352  * cdef inline tuple PyDataType_SHAPE(dtype d):
6353  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
6354  * return <tuple>d.subarray.shape
6355  * else:
6356  */
6357  }
6358 
6359  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":761
6360  * return <tuple>d.subarray.shape
6361  * else:
6362  * return () # <<<<<<<<<<<<<<
6363  *
6364  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
6365  */
6366  /*else*/ {
6367  __Pyx_XDECREF(__pyx_r);
6368  __Pyx_INCREF(__pyx_empty_tuple);
6369  __pyx_r = __pyx_empty_tuple;
6370  goto __pyx_L0;
6371  }
6372 
6373  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":757
6374  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6375  *
6376  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
6377  * if PyDataType_HASSUBARRAY(d):
6378  * return <tuple>d.subarray.shape
6379  */
6380 
6381  /* function exit code */
6382  __pyx_L0:;
6383  __Pyx_XGIVEREF(__pyx_r);
6384  __Pyx_RefNannyFinishContext();
6385  return __pyx_r;
6386 }
6387 
6388 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":763
6389  * return ()
6390  *
6391  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
6392  * # Recursive utility function used in __getbuffer__ to get format
6393  * # string. The new location in the format string is returned.
6394  */
6395 
6396 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
6397  PyArray_Descr *__pyx_v_child = 0;
6398  int __pyx_v_endian_detector;
6399  int __pyx_v_little_endian;
6400  PyObject *__pyx_v_fields = 0;
6401  PyObject *__pyx_v_childname = NULL;
6402  PyObject *__pyx_v_new_offset = NULL;
6403  PyObject *__pyx_v_t = NULL;
6404  char *__pyx_r;
6405  __Pyx_RefNannyDeclarations
6406  PyObject *__pyx_t_1 = NULL;
6407  Py_ssize_t __pyx_t_2;
6408  PyObject *__pyx_t_3 = NULL;
6409  PyObject *__pyx_t_4 = NULL;
6410  int __pyx_t_5;
6411  int __pyx_t_6;
6412  int __pyx_t_7;
6413  long __pyx_t_8;
6414  char *__pyx_t_9;
6415  int __pyx_lineno = 0;
6416  const char *__pyx_filename = NULL;
6417  int __pyx_clineno = 0;
6418  __Pyx_RefNannySetupContext("_util_dtypestring", 0);
6419 
6420  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":768
6421  *
6422  * cdef dtype child
6423  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
6424  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
6425  * cdef tuple fields
6426  */
6427  __pyx_v_endian_detector = 1;
6428 
6429  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":769
6430  * cdef dtype child
6431  * cdef int endian_detector = 1
6432  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
6433  * cdef tuple fields
6434  *
6435  */
6436  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
6437 
6438  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":772
6439  * cdef tuple fields
6440  *
6441  * for childname in descr.names: # <<<<<<<<<<<<<<
6442  * fields = descr.fields[childname]
6443  * child, new_offset = fields
6444  */
6445  if (unlikely(__pyx_v_descr->names == Py_None)) {
6446  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
6447  __PYX_ERR(2, 772, __pyx_L1_error)
6448  }
6449  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
6450  for (;;) {
6451  if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
6452  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6453  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(2, 772, __pyx_L1_error)
6454  #else
6455  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 772, __pyx_L1_error)
6456  __Pyx_GOTREF(__pyx_t_3);
6457  #endif
6458  __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
6459  __pyx_t_3 = 0;
6460 
6461  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":773
6462  *
6463  * for childname in descr.names:
6464  * fields = descr.fields[childname] # <<<<<<<<<<<<<<
6465  * child, new_offset = fields
6466  *
6467  */
6468  if (unlikely(__pyx_v_descr->fields == Py_None)) {
6469  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6470  __PYX_ERR(2, 773, __pyx_L1_error)
6471  }
6472  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 773, __pyx_L1_error)
6473  __Pyx_GOTREF(__pyx_t_3);
6474  if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 773, __pyx_L1_error)
6475  __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
6476  __pyx_t_3 = 0;
6477 
6478  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":774
6479  * for childname in descr.names:
6480  * fields = descr.fields[childname]
6481  * child, new_offset = fields # <<<<<<<<<<<<<<
6482  *
6483  * if (end - f) - <int>(new_offset - offset[0]) < 15:
6484  */
6485  if (likely(__pyx_v_fields != Py_None)) {
6486  PyObject* sequence = __pyx_v_fields;
6487  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6488  if (unlikely(size != 2)) {
6489  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
6490  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6491  __PYX_ERR(2, 774, __pyx_L1_error)
6492  }
6493  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6494  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
6495  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
6496  __Pyx_INCREF(__pyx_t_3);
6497  __Pyx_INCREF(__pyx_t_4);
6498  #else
6499  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 774, __pyx_L1_error)
6500  __Pyx_GOTREF(__pyx_t_3);
6501  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 774, __pyx_L1_error)
6502  __Pyx_GOTREF(__pyx_t_4);
6503  #endif
6504  } else {
6505  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 774, __pyx_L1_error)
6506  }
6507  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 774, __pyx_L1_error)
6508  __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
6509  __pyx_t_3 = 0;
6510  __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
6511  __pyx_t_4 = 0;
6512 
6513  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":776
6514  * child, new_offset = fields
6515  *
6516  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
6517  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
6518  *
6519  */
6520  __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 776, __pyx_L1_error)
6521  __Pyx_GOTREF(__pyx_t_4);
6522  __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 776, __pyx_L1_error)
6523  __Pyx_GOTREF(__pyx_t_3);
6524  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6525  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 776, __pyx_L1_error)
6526  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6527  __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
6528  if (unlikely(__pyx_t_6)) {
6529 
6530  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":777
6531  *
6532  * if (end - f) - <int>(new_offset - offset[0]) < 15:
6533  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
6534  *
6535  * if ((child.byteorder == c'>' and little_endian) or
6536  */
6537  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 777, __pyx_L1_error)
6538  __Pyx_GOTREF(__pyx_t_3);
6539  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6540  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6541  __PYX_ERR(2, 777, __pyx_L1_error)
6542 
6543  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":776
6544  * child, new_offset = fields
6545  *
6546  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
6547  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
6548  *
6549  */
6550  }
6551 
6552  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":779
6553  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
6554  *
6555  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6556  * (child.byteorder == c'<' and not little_endian)):
6557  * raise ValueError(u"Non-native byte order not supported")
6558  */
6559  __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
6560  if (!__pyx_t_7) {
6561  goto __pyx_L8_next_or;
6562  } else {
6563  }
6564  __pyx_t_7 = (__pyx_v_little_endian != 0);
6565  if (!__pyx_t_7) {
6566  } else {
6567  __pyx_t_6 = __pyx_t_7;
6568  goto __pyx_L7_bool_binop_done;
6569  }
6570  __pyx_L8_next_or:;
6571 
6572  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":780
6573  *
6574  * if ((child.byteorder == c'>' and little_endian) or
6575  * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
6576  * raise ValueError(u"Non-native byte order not supported")
6577  * # One could encode it in the format string and have Cython
6578  */
6579  __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
6580  if (__pyx_t_7) {
6581  } else {
6582  __pyx_t_6 = __pyx_t_7;
6583  goto __pyx_L7_bool_binop_done;
6584  }
6585  __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
6586  __pyx_t_6 = __pyx_t_7;
6587  __pyx_L7_bool_binop_done:;
6588 
6589  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":779
6590  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
6591  *
6592  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6593  * (child.byteorder == c'<' and not little_endian)):
6594  * raise ValueError(u"Non-native byte order not supported")
6595  */
6596  if (unlikely(__pyx_t_6)) {
6597 
6598  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":781
6599  * if ((child.byteorder == c'>' and little_endian) or
6600  * (child.byteorder == c'<' and not little_endian)):
6601  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
6602  * # One could encode it in the format string and have Cython
6603  * # complain instead, BUT: < and > in format strings also imply
6604  */
6605  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 781, __pyx_L1_error)
6606  __Pyx_GOTREF(__pyx_t_3);
6607  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6608  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6609  __PYX_ERR(2, 781, __pyx_L1_error)
6610 
6611  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":779
6612  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
6613  *
6614  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6615  * (child.byteorder == c'<' and not little_endian)):
6616  * raise ValueError(u"Non-native byte order not supported")
6617  */
6618  }
6619 
6620  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":791
6621  *
6622  * # Output padding bytes
6623  * while offset[0] < new_offset: # <<<<<<<<<<<<<<
6624  * f[0] = 120 # "x"; pad byte
6625  * f += 1
6626  */
6627  while (1) {
6628  __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 791, __pyx_L1_error)
6629  __Pyx_GOTREF(__pyx_t_3);
6630  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 791, __pyx_L1_error)
6631  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6632  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 791, __pyx_L1_error)
6633  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6634  if (!__pyx_t_6) break;
6635 
6636  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":792
6637  * # Output padding bytes
6638  * while offset[0] < new_offset:
6639  * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
6640  * f += 1
6641  * offset[0] += 1
6642  */
6643  (__pyx_v_f[0]) = 0x78;
6644 
6645  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":793
6646  * while offset[0] < new_offset:
6647  * f[0] = 120 # "x"; pad byte
6648  * f += 1 # <<<<<<<<<<<<<<
6649  * offset[0] += 1
6650  *
6651  */
6652  __pyx_v_f = (__pyx_v_f + 1);
6653 
6654  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":794
6655  * f[0] = 120 # "x"; pad byte
6656  * f += 1
6657  * offset[0] += 1 # <<<<<<<<<<<<<<
6658  *
6659  * offset[0] += child.itemsize
6660  */
6661  __pyx_t_8 = 0;
6662  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
6663  }
6664 
6665  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":796
6666  * offset[0] += 1
6667  *
6668  * offset[0] += child.itemsize # <<<<<<<<<<<<<<
6669  *
6670  * if not PyDataType_HASFIELDS(child):
6671  */
6672  __pyx_t_8 = 0;
6673  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
6674 
6675  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":798
6676  * offset[0] += child.itemsize
6677  *
6678  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
6679  * t = child.type_num
6680  * if end - f < 5:
6681  */
6682  __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
6683  if (__pyx_t_6) {
6684 
6685  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":799
6686  *
6687  * if not PyDataType_HASFIELDS(child):
6688  * t = child.type_num # <<<<<<<<<<<<<<
6689  * if end - f < 5:
6690  * raise RuntimeError(u"Format string allocated too short.")
6691  */
6692  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 799, __pyx_L1_error)
6693  __Pyx_GOTREF(__pyx_t_4);
6694  __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
6695  __pyx_t_4 = 0;
6696 
6697  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":800
6698  * if not PyDataType_HASFIELDS(child):
6699  * t = child.type_num
6700  * if end - f < 5: # <<<<<<<<<<<<<<
6701  * raise RuntimeError(u"Format string allocated too short.")
6702  *
6703  */
6704  __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
6705  if (unlikely(__pyx_t_6)) {
6706 
6707  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":801
6708  * t = child.type_num
6709  * if end - f < 5:
6710  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
6711  *
6712  * # Until ticket #99 is fixed, use integers to avoid warnings
6713  */
6714  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 801, __pyx_L1_error)
6715  __Pyx_GOTREF(__pyx_t_4);
6716  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
6717  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6718  __PYX_ERR(2, 801, __pyx_L1_error)
6719 
6720  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":800
6721  * if not PyDataType_HASFIELDS(child):
6722  * t = child.type_num
6723  * if end - f < 5: # <<<<<<<<<<<<<<
6724  * raise RuntimeError(u"Format string allocated too short.")
6725  *
6726  */
6727  }
6728 
6729  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":804
6730  *
6731  * # Until ticket #99 is fixed, use integers to avoid warnings
6732  * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
6733  * elif t == NPY_UBYTE: f[0] = 66 #"B"
6734  * elif t == NPY_SHORT: f[0] = 104 #"h"
6735  */
6736  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 804, __pyx_L1_error)
6737  __Pyx_GOTREF(__pyx_t_4);
6738  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 804, __pyx_L1_error)
6739  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6740  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 804, __pyx_L1_error)
6741  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6742  if (__pyx_t_6) {
6743  (__pyx_v_f[0]) = 98;
6744  goto __pyx_L15;
6745  }
6746 
6747  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":805
6748  * # Until ticket #99 is fixed, use integers to avoid warnings
6749  * if t == NPY_BYTE: f[0] = 98 #"b"
6750  * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
6751  * elif t == NPY_SHORT: f[0] = 104 #"h"
6752  * elif t == NPY_USHORT: f[0] = 72 #"H"
6753  */
6754  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 805, __pyx_L1_error)
6755  __Pyx_GOTREF(__pyx_t_3);
6756  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 805, __pyx_L1_error)
6757  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6758  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 805, __pyx_L1_error)
6759  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6760  if (__pyx_t_6) {
6761  (__pyx_v_f[0]) = 66;
6762  goto __pyx_L15;
6763  }
6764 
6765  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":806
6766  * if t == NPY_BYTE: f[0] = 98 #"b"
6767  * elif t == NPY_UBYTE: f[0] = 66 #"B"
6768  * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
6769  * elif t == NPY_USHORT: f[0] = 72 #"H"
6770  * elif t == NPY_INT: f[0] = 105 #"i"
6771  */
6772  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 806, __pyx_L1_error)
6773  __Pyx_GOTREF(__pyx_t_4);
6774  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 806, __pyx_L1_error)
6775  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6776  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 806, __pyx_L1_error)
6777  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6778  if (__pyx_t_6) {
6779  (__pyx_v_f[0]) = 0x68;
6780  goto __pyx_L15;
6781  }
6782 
6783  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":807
6784  * elif t == NPY_UBYTE: f[0] = 66 #"B"
6785  * elif t == NPY_SHORT: f[0] = 104 #"h"
6786  * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
6787  * elif t == NPY_INT: f[0] = 105 #"i"
6788  * elif t == NPY_UINT: f[0] = 73 #"I"
6789  */
6790  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 807, __pyx_L1_error)
6791  __Pyx_GOTREF(__pyx_t_3);
6792  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 807, __pyx_L1_error)
6793  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6794  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 807, __pyx_L1_error)
6795  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6796  if (__pyx_t_6) {
6797  (__pyx_v_f[0]) = 72;
6798  goto __pyx_L15;
6799  }
6800 
6801  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":808
6802  * elif t == NPY_SHORT: f[0] = 104 #"h"
6803  * elif t == NPY_USHORT: f[0] = 72 #"H"
6804  * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
6805  * elif t == NPY_UINT: f[0] = 73 #"I"
6806  * elif t == NPY_LONG: f[0] = 108 #"l"
6807  */
6808  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 808, __pyx_L1_error)
6809  __Pyx_GOTREF(__pyx_t_4);
6810  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 808, __pyx_L1_error)
6811  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6812  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 808, __pyx_L1_error)
6813  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6814  if (__pyx_t_6) {
6815  (__pyx_v_f[0]) = 0x69;
6816  goto __pyx_L15;
6817  }
6818 
6819  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":809
6820  * elif t == NPY_USHORT: f[0] = 72 #"H"
6821  * elif t == NPY_INT: f[0] = 105 #"i"
6822  * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
6823  * elif t == NPY_LONG: f[0] = 108 #"l"
6824  * elif t == NPY_ULONG: f[0] = 76 #"L"
6825  */
6826  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 809, __pyx_L1_error)
6827  __Pyx_GOTREF(__pyx_t_3);
6828  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 809, __pyx_L1_error)
6829  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6830  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 809, __pyx_L1_error)
6831  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6832  if (__pyx_t_6) {
6833  (__pyx_v_f[0]) = 73;
6834  goto __pyx_L15;
6835  }
6836 
6837  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":810
6838  * elif t == NPY_INT: f[0] = 105 #"i"
6839  * elif t == NPY_UINT: f[0] = 73 #"I"
6840  * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
6841  * elif t == NPY_ULONG: f[0] = 76 #"L"
6842  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
6843  */
6844  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 810, __pyx_L1_error)
6845  __Pyx_GOTREF(__pyx_t_4);
6846  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 810, __pyx_L1_error)
6847  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6848  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 810, __pyx_L1_error)
6849  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6850  if (__pyx_t_6) {
6851  (__pyx_v_f[0]) = 0x6C;
6852  goto __pyx_L15;
6853  }
6854 
6855  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":811
6856  * elif t == NPY_UINT: f[0] = 73 #"I"
6857  * elif t == NPY_LONG: f[0] = 108 #"l"
6858  * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
6859  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
6860  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
6861  */
6862  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 811, __pyx_L1_error)
6863  __Pyx_GOTREF(__pyx_t_3);
6864  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 811, __pyx_L1_error)
6865  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6866  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 811, __pyx_L1_error)
6867  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6868  if (__pyx_t_6) {
6869  (__pyx_v_f[0]) = 76;
6870  goto __pyx_L15;
6871  }
6872 
6873  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":812
6874  * elif t == NPY_LONG: f[0] = 108 #"l"
6875  * elif t == NPY_ULONG: f[0] = 76 #"L"
6876  * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
6877  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
6878  * elif t == NPY_FLOAT: f[0] = 102 #"f"
6879  */
6880  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 812, __pyx_L1_error)
6881  __Pyx_GOTREF(__pyx_t_4);
6882  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 812, __pyx_L1_error)
6883  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6884  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 812, __pyx_L1_error)
6885  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6886  if (__pyx_t_6) {
6887  (__pyx_v_f[0]) = 0x71;
6888  goto __pyx_L15;
6889  }
6890 
6891  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":813
6892  * elif t == NPY_ULONG: f[0] = 76 #"L"
6893  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
6894  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
6895  * elif t == NPY_FLOAT: f[0] = 102 #"f"
6896  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
6897  */
6898  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 813, __pyx_L1_error)
6899  __Pyx_GOTREF(__pyx_t_3);
6900  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 813, __pyx_L1_error)
6901  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6902  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 813, __pyx_L1_error)
6903  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6904  if (__pyx_t_6) {
6905  (__pyx_v_f[0]) = 81;
6906  goto __pyx_L15;
6907  }
6908 
6909  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":814
6910  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
6911  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
6912  * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
6913  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
6914  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
6915  */
6916  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 814, __pyx_L1_error)
6917  __Pyx_GOTREF(__pyx_t_4);
6918  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 814, __pyx_L1_error)
6919  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6920  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 814, __pyx_L1_error)
6921  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6922  if (__pyx_t_6) {
6923  (__pyx_v_f[0]) = 0x66;
6924  goto __pyx_L15;
6925  }
6926 
6927  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":815
6928  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
6929  * elif t == NPY_FLOAT: f[0] = 102 #"f"
6930  * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
6931  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
6932  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
6933  */
6934  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 815, __pyx_L1_error)
6935  __Pyx_GOTREF(__pyx_t_3);
6936  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 815, __pyx_L1_error)
6937  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6938  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 815, __pyx_L1_error)
6939  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6940  if (__pyx_t_6) {
6941  (__pyx_v_f[0]) = 0x64;
6942  goto __pyx_L15;
6943  }
6944 
6945  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":816
6946  * elif t == NPY_FLOAT: f[0] = 102 #"f"
6947  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
6948  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
6949  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
6950  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
6951  */
6952  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 816, __pyx_L1_error)
6953  __Pyx_GOTREF(__pyx_t_4);
6954  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 816, __pyx_L1_error)
6955  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6956  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 816, __pyx_L1_error)
6957  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6958  if (__pyx_t_6) {
6959  (__pyx_v_f[0]) = 0x67;
6960  goto __pyx_L15;
6961  }
6962 
6963  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":817
6964  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
6965  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
6966  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
6967  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
6968  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
6969  */
6970  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 817, __pyx_L1_error)
6971  __Pyx_GOTREF(__pyx_t_3);
6972  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 817, __pyx_L1_error)
6973  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6974  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 817, __pyx_L1_error)
6975  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6976  if (__pyx_t_6) {
6977  (__pyx_v_f[0]) = 90;
6978  (__pyx_v_f[1]) = 0x66;
6979  __pyx_v_f = (__pyx_v_f + 1);
6980  goto __pyx_L15;
6981  }
6982 
6983  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":818
6984  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
6985  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
6986  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
6987  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
6988  * elif t == NPY_OBJECT: f[0] = 79 #"O"
6989  */
6990  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 818, __pyx_L1_error)
6991  __Pyx_GOTREF(__pyx_t_4);
6992  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 818, __pyx_L1_error)
6993  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6994  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 818, __pyx_L1_error)
6995  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6996  if (__pyx_t_6) {
6997  (__pyx_v_f[0]) = 90;
6998  (__pyx_v_f[1]) = 0x64;
6999  __pyx_v_f = (__pyx_v_f + 1);
7000  goto __pyx_L15;
7001  }
7002 
7003  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":819
7004  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7005  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7006  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
7007  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7008  * else:
7009  */
7010  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 819, __pyx_L1_error)
7011  __Pyx_GOTREF(__pyx_t_3);
7012  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 819, __pyx_L1_error)
7013  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7014  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 819, __pyx_L1_error)
7015  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7016  if (__pyx_t_6) {
7017  (__pyx_v_f[0]) = 90;
7018  (__pyx_v_f[1]) = 0x67;
7019  __pyx_v_f = (__pyx_v_f + 1);
7020  goto __pyx_L15;
7021  }
7022 
7023  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":820
7024  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7025  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7026  * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
7027  * else:
7028  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7029  */
7030  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 820, __pyx_L1_error)
7031  __Pyx_GOTREF(__pyx_t_4);
7032  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 820, __pyx_L1_error)
7033  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7034  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 820, __pyx_L1_error)
7035  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7036  if (likely(__pyx_t_6)) {
7037  (__pyx_v_f[0]) = 79;
7038  goto __pyx_L15;
7039  }
7040 
7041  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":822
7042  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7043  * else:
7044  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
7045  * f += 1
7046  * else:
7047  */
7048  /*else*/ {
7049  __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 822, __pyx_L1_error)
7050  __Pyx_GOTREF(__pyx_t_3);
7051  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 822, __pyx_L1_error)
7052  __Pyx_GOTREF(__pyx_t_4);
7053  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7054  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7055  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7056  __PYX_ERR(2, 822, __pyx_L1_error)
7057  }
7058  __pyx_L15:;
7059 
7060  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":823
7061  * else:
7062  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7063  * f += 1 # <<<<<<<<<<<<<<
7064  * else:
7065  * # Cython ignores struct boundary information ("T{...}"),
7066  */
7067  __pyx_v_f = (__pyx_v_f + 1);
7068 
7069  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":798
7070  * offset[0] += child.itemsize
7071  *
7072  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
7073  * t = child.type_num
7074  * if end - f < 5:
7075  */
7076  goto __pyx_L13;
7077  }
7078 
7079  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":827
7080  * # Cython ignores struct boundary information ("T{...}"),
7081  * # so don't output it
7082  * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
7083  * return f
7084  *
7085  */
7086  /*else*/ {
7087  __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(2, 827, __pyx_L1_error)
7088  __pyx_v_f = __pyx_t_9;
7089  }
7090  __pyx_L13:;
7091 
7092  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":772
7093  * cdef tuple fields
7094  *
7095  * for childname in descr.names: # <<<<<<<<<<<<<<
7096  * fields = descr.fields[childname]
7097  * child, new_offset = fields
7098  */
7099  }
7100  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7101 
7102  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":828
7103  * # so don't output it
7104  * f = _util_dtypestring(child, f, end, offset)
7105  * return f # <<<<<<<<<<<<<<
7106  *
7107  *
7108  */
7109  __pyx_r = __pyx_v_f;
7110  goto __pyx_L0;
7111 
7112  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":763
7113  * return ()
7114  *
7115  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
7116  * # Recursive utility function used in __getbuffer__ to get format
7117  * # string. The new location in the format string is returned.
7118  */
7119 
7120  /* function exit code */
7121  __pyx_L1_error:;
7122  __Pyx_XDECREF(__pyx_t_1);
7123  __Pyx_XDECREF(__pyx_t_3);
7124  __Pyx_XDECREF(__pyx_t_4);
7125  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
7126  __pyx_r = NULL;
7127  __pyx_L0:;
7128  __Pyx_XDECREF((PyObject *)__pyx_v_child);
7129  __Pyx_XDECREF(__pyx_v_fields);
7130  __Pyx_XDECREF(__pyx_v_childname);
7131  __Pyx_XDECREF(__pyx_v_new_offset);
7132  __Pyx_XDECREF(__pyx_v_t);
7133  __Pyx_RefNannyFinishContext();
7134  return __pyx_r;
7135 }
7136 
7137 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":943
7138  * int _import_umath() except -1
7139  *
7140  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7141  * Py_INCREF(base) # important to do this before stealing the reference below!
7142  * PyArray_SetBaseObject(arr, base)
7143  */
7144 
7145 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
7146  __Pyx_RefNannyDeclarations
7147  __Pyx_RefNannySetupContext("set_array_base", 0);
7148 
7149  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":944
7150  *
7151  * cdef inline void set_array_base(ndarray arr, object base):
7152  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
7153  * PyArray_SetBaseObject(arr, base)
7154  *
7155  */
7156  Py_INCREF(__pyx_v_base);
7157 
7158  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":945
7159  * cdef inline void set_array_base(ndarray arr, object base):
7160  * Py_INCREF(base) # important to do this before stealing the reference below!
7161  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
7162  *
7163  * cdef inline object get_array_base(ndarray arr):
7164  */
7165  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
7166 
7167  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":943
7168  * int _import_umath() except -1
7169  *
7170  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7171  * Py_INCREF(base) # important to do this before stealing the reference below!
7172  * PyArray_SetBaseObject(arr, base)
7173  */
7174 
7175  /* function exit code */
7176  __Pyx_RefNannyFinishContext();
7177 }
7178 
7179 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":947
7180  * PyArray_SetBaseObject(arr, base)
7181  *
7182  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7183  * base = PyArray_BASE(arr)
7184  * if base is NULL:
7185  */
7186 
7187 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
7188  PyObject *__pyx_v_base;
7189  PyObject *__pyx_r = NULL;
7190  __Pyx_RefNannyDeclarations
7191  int __pyx_t_1;
7192  __Pyx_RefNannySetupContext("get_array_base", 0);
7193 
7194  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":948
7195  *
7196  * cdef inline object get_array_base(ndarray arr):
7197  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
7198  * if base is NULL:
7199  * return None
7200  */
7201  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
7202 
7203  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":949
7204  * cdef inline object get_array_base(ndarray arr):
7205  * base = PyArray_BASE(arr)
7206  * if base is NULL: # <<<<<<<<<<<<<<
7207  * return None
7208  * return <object>base
7209  */
7210  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
7211  if (__pyx_t_1) {
7212 
7213  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":950
7214  * base = PyArray_BASE(arr)
7215  * if base is NULL:
7216  * return None # <<<<<<<<<<<<<<
7217  * return <object>base
7218  *
7219  */
7220  __Pyx_XDECREF(__pyx_r);
7221  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7222  goto __pyx_L0;
7223 
7224  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":949
7225  * cdef inline object get_array_base(ndarray arr):
7226  * base = PyArray_BASE(arr)
7227  * if base is NULL: # <<<<<<<<<<<<<<
7228  * return None
7229  * return <object>base
7230  */
7231  }
7232 
7233  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":951
7234  * if base is NULL:
7235  * return None
7236  * return <object>base # <<<<<<<<<<<<<<
7237  *
7238  * # Versions of the import_* functions which are more suitable for
7239  */
7240  __Pyx_XDECREF(__pyx_r);
7241  __Pyx_INCREF(((PyObject *)__pyx_v_base));
7242  __pyx_r = ((PyObject *)__pyx_v_base);
7243  goto __pyx_L0;
7244 
7245  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":947
7246  * PyArray_SetBaseObject(arr, base)
7247  *
7248  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7249  * base = PyArray_BASE(arr)
7250  * if base is NULL:
7251  */
7252 
7253  /* function exit code */
7254  __pyx_L0:;
7255  __Pyx_XGIVEREF(__pyx_r);
7256  __Pyx_RefNannyFinishContext();
7257  return __pyx_r;
7258 }
7259 
7260 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":955
7261  * # Versions of the import_* functions which are more suitable for
7262  * # Cython code.
7263  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7264  * try:
7265  * __pyx_import_array()
7266  */
7267 
7268 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
7269  int __pyx_r;
7270  __Pyx_RefNannyDeclarations
7271  PyObject *__pyx_t_1 = NULL;
7272  PyObject *__pyx_t_2 = NULL;
7273  PyObject *__pyx_t_3 = NULL;
7274  int __pyx_t_4;
7275  PyObject *__pyx_t_5 = NULL;
7276  PyObject *__pyx_t_6 = NULL;
7277  PyObject *__pyx_t_7 = NULL;
7278  PyObject *__pyx_t_8 = NULL;
7279  int __pyx_lineno = 0;
7280  const char *__pyx_filename = NULL;
7281  int __pyx_clineno = 0;
7282  __Pyx_RefNannySetupContext("import_array", 0);
7283 
7284  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":956
7285  * # Cython code.
7286  * cdef inline int import_array() except -1:
7287  * try: # <<<<<<<<<<<<<<
7288  * __pyx_import_array()
7289  * except Exception:
7290  */
7291  {
7292  __Pyx_PyThreadState_declare
7293  __Pyx_PyThreadState_assign
7294  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7295  __Pyx_XGOTREF(__pyx_t_1);
7296  __Pyx_XGOTREF(__pyx_t_2);
7297  __Pyx_XGOTREF(__pyx_t_3);
7298  /*try:*/ {
7299 
7300  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":957
7301  * cdef inline int import_array() except -1:
7302  * try:
7303  * __pyx_import_array() # <<<<<<<<<<<<<<
7304  * except Exception:
7305  * raise ImportError("numpy.core.multiarray failed to import")
7306  */
7307  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 957, __pyx_L3_error)
7308 
7309  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":956
7310  * # Cython code.
7311  * cdef inline int import_array() except -1:
7312  * try: # <<<<<<<<<<<<<<
7313  * __pyx_import_array()
7314  * except Exception:
7315  */
7316  }
7317  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7318  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7319  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7320  goto __pyx_L8_try_end;
7321  __pyx_L3_error:;
7322 
7323  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":958
7324  * try:
7325  * __pyx_import_array()
7326  * except Exception: # <<<<<<<<<<<<<<
7327  * raise ImportError("numpy.core.multiarray failed to import")
7328  *
7329  */
7330  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7331  if (__pyx_t_4) {
7332  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7333  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 958, __pyx_L5_except_error)
7334  __Pyx_GOTREF(__pyx_t_5);
7335  __Pyx_GOTREF(__pyx_t_6);
7336  __Pyx_GOTREF(__pyx_t_7);
7337 
7338  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":959
7339  * __pyx_import_array()
7340  * except Exception:
7341  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
7342  *
7343  * cdef inline int import_umath() except -1:
7344  */
7345  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 959, __pyx_L5_except_error)
7346  __Pyx_GOTREF(__pyx_t_8);
7347  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7348  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7349  __PYX_ERR(2, 959, __pyx_L5_except_error)
7350  }
7351  goto __pyx_L5_except_error;
7352  __pyx_L5_except_error:;
7353 
7354  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":956
7355  * # Cython code.
7356  * cdef inline int import_array() except -1:
7357  * try: # <<<<<<<<<<<<<<
7358  * __pyx_import_array()
7359  * except Exception:
7360  */
7361  __Pyx_XGIVEREF(__pyx_t_1);
7362  __Pyx_XGIVEREF(__pyx_t_2);
7363  __Pyx_XGIVEREF(__pyx_t_3);
7364  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7365  goto __pyx_L1_error;
7366  __pyx_L8_try_end:;
7367  }
7368 
7369  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":955
7370  * # Versions of the import_* functions which are more suitable for
7371  * # Cython code.
7372  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7373  * try:
7374  * __pyx_import_array()
7375  */
7376 
7377  /* function exit code */
7378  __pyx_r = 0;
7379  goto __pyx_L0;
7380  __pyx_L1_error:;
7381  __Pyx_XDECREF(__pyx_t_5);
7382  __Pyx_XDECREF(__pyx_t_6);
7383  __Pyx_XDECREF(__pyx_t_7);
7384  __Pyx_XDECREF(__pyx_t_8);
7385  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7386  __pyx_r = -1;
7387  __pyx_L0:;
7388  __Pyx_RefNannyFinishContext();
7389  return __pyx_r;
7390 }
7391 
7392 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":961
7393  * raise ImportError("numpy.core.multiarray failed to import")
7394  *
7395  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
7396  * try:
7397  * _import_umath()
7398  */
7399 
7400 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
7401  int __pyx_r;
7402  __Pyx_RefNannyDeclarations
7403  PyObject *__pyx_t_1 = NULL;
7404  PyObject *__pyx_t_2 = NULL;
7405  PyObject *__pyx_t_3 = NULL;
7406  int __pyx_t_4;
7407  PyObject *__pyx_t_5 = NULL;
7408  PyObject *__pyx_t_6 = NULL;
7409  PyObject *__pyx_t_7 = NULL;
7410  PyObject *__pyx_t_8 = NULL;
7411  int __pyx_lineno = 0;
7412  const char *__pyx_filename = NULL;
7413  int __pyx_clineno = 0;
7414  __Pyx_RefNannySetupContext("import_umath", 0);
7415 
7416  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":962
7417  *
7418  * cdef inline int import_umath() except -1:
7419  * try: # <<<<<<<<<<<<<<
7420  * _import_umath()
7421  * except Exception:
7422  */
7423  {
7424  __Pyx_PyThreadState_declare
7425  __Pyx_PyThreadState_assign
7426  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7427  __Pyx_XGOTREF(__pyx_t_1);
7428  __Pyx_XGOTREF(__pyx_t_2);
7429  __Pyx_XGOTREF(__pyx_t_3);
7430  /*try:*/ {
7431 
7432  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":963
7433  * cdef inline int import_umath() except -1:
7434  * try:
7435  * _import_umath() # <<<<<<<<<<<<<<
7436  * except Exception:
7437  * raise ImportError("numpy.core.umath failed to import")
7438  */
7439  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 963, __pyx_L3_error)
7440 
7441  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":962
7442  *
7443  * cdef inline int import_umath() except -1:
7444  * try: # <<<<<<<<<<<<<<
7445  * _import_umath()
7446  * except Exception:
7447  */
7448  }
7449  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7450  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7451  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7452  goto __pyx_L8_try_end;
7453  __pyx_L3_error:;
7454 
7455  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":964
7456  * try:
7457  * _import_umath()
7458  * except Exception: # <<<<<<<<<<<<<<
7459  * raise ImportError("numpy.core.umath failed to import")
7460  *
7461  */
7462  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7463  if (__pyx_t_4) {
7464  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7465  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 964, __pyx_L5_except_error)
7466  __Pyx_GOTREF(__pyx_t_5);
7467  __Pyx_GOTREF(__pyx_t_6);
7468  __Pyx_GOTREF(__pyx_t_7);
7469 
7470  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":965
7471  * _import_umath()
7472  * except Exception:
7473  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
7474  *
7475  * cdef inline int import_ufunc() except -1:
7476  */
7477  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 965, __pyx_L5_except_error)
7478  __Pyx_GOTREF(__pyx_t_8);
7479  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7480  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7481  __PYX_ERR(2, 965, __pyx_L5_except_error)
7482  }
7483  goto __pyx_L5_except_error;
7484  __pyx_L5_except_error:;
7485 
7486  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":962
7487  *
7488  * cdef inline int import_umath() except -1:
7489  * try: # <<<<<<<<<<<<<<
7490  * _import_umath()
7491  * except Exception:
7492  */
7493  __Pyx_XGIVEREF(__pyx_t_1);
7494  __Pyx_XGIVEREF(__pyx_t_2);
7495  __Pyx_XGIVEREF(__pyx_t_3);
7496  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7497  goto __pyx_L1_error;
7498  __pyx_L8_try_end:;
7499  }
7500 
7501  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":961
7502  * raise ImportError("numpy.core.multiarray failed to import")
7503  *
7504  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
7505  * try:
7506  * _import_umath()
7507  */
7508 
7509  /* function exit code */
7510  __pyx_r = 0;
7511  goto __pyx_L0;
7512  __pyx_L1_error:;
7513  __Pyx_XDECREF(__pyx_t_5);
7514  __Pyx_XDECREF(__pyx_t_6);
7515  __Pyx_XDECREF(__pyx_t_7);
7516  __Pyx_XDECREF(__pyx_t_8);
7517  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7518  __pyx_r = -1;
7519  __pyx_L0:;
7520  __Pyx_RefNannyFinishContext();
7521  return __pyx_r;
7522 }
7523 
7524 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":967
7525  * raise ImportError("numpy.core.umath failed to import")
7526  *
7527  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
7528  * try:
7529  * _import_umath()
7530  */
7531 
7532 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
7533  int __pyx_r;
7534  __Pyx_RefNannyDeclarations
7535  PyObject *__pyx_t_1 = NULL;
7536  PyObject *__pyx_t_2 = NULL;
7537  PyObject *__pyx_t_3 = NULL;
7538  int __pyx_t_4;
7539  PyObject *__pyx_t_5 = NULL;
7540  PyObject *__pyx_t_6 = NULL;
7541  PyObject *__pyx_t_7 = NULL;
7542  PyObject *__pyx_t_8 = NULL;
7543  int __pyx_lineno = 0;
7544  const char *__pyx_filename = NULL;
7545  int __pyx_clineno = 0;
7546  __Pyx_RefNannySetupContext("import_ufunc", 0);
7547 
7548  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":968
7549  *
7550  * cdef inline int import_ufunc() except -1:
7551  * try: # <<<<<<<<<<<<<<
7552  * _import_umath()
7553  * except Exception:
7554  */
7555  {
7556  __Pyx_PyThreadState_declare
7557  __Pyx_PyThreadState_assign
7558  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7559  __Pyx_XGOTREF(__pyx_t_1);
7560  __Pyx_XGOTREF(__pyx_t_2);
7561  __Pyx_XGOTREF(__pyx_t_3);
7562  /*try:*/ {
7563 
7564  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":969
7565  * cdef inline int import_ufunc() except -1:
7566  * try:
7567  * _import_umath() # <<<<<<<<<<<<<<
7568  * except Exception:
7569  * raise ImportError("numpy.core.umath failed to import")
7570  */
7571  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 969, __pyx_L3_error)
7572 
7573  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":968
7574  *
7575  * cdef inline int import_ufunc() except -1:
7576  * try: # <<<<<<<<<<<<<<
7577  * _import_umath()
7578  * except Exception:
7579  */
7580  }
7581  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7582  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7583  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7584  goto __pyx_L8_try_end;
7585  __pyx_L3_error:;
7586 
7587  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":970
7588  * try:
7589  * _import_umath()
7590  * except Exception: # <<<<<<<<<<<<<<
7591  * raise ImportError("numpy.core.umath failed to import")
7592  *
7593  */
7594  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7595  if (__pyx_t_4) {
7596  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7597  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 970, __pyx_L5_except_error)
7598  __Pyx_GOTREF(__pyx_t_5);
7599  __Pyx_GOTREF(__pyx_t_6);
7600  __Pyx_GOTREF(__pyx_t_7);
7601 
7602  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":971
7603  * _import_umath()
7604  * except Exception:
7605  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
7606  *
7607  * cdef extern from *:
7608  */
7609  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 971, __pyx_L5_except_error)
7610  __Pyx_GOTREF(__pyx_t_8);
7611  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7612  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7613  __PYX_ERR(2, 971, __pyx_L5_except_error)
7614  }
7615  goto __pyx_L5_except_error;
7616  __pyx_L5_except_error:;
7617 
7618  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":968
7619  *
7620  * cdef inline int import_ufunc() except -1:
7621  * try: # <<<<<<<<<<<<<<
7622  * _import_umath()
7623  * except Exception:
7624  */
7625  __Pyx_XGIVEREF(__pyx_t_1);
7626  __Pyx_XGIVEREF(__pyx_t_2);
7627  __Pyx_XGIVEREF(__pyx_t_3);
7628  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7629  goto __pyx_L1_error;
7630  __pyx_L8_try_end:;
7631  }
7632 
7633  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":967
7634  * raise ImportError("numpy.core.umath failed to import")
7635  *
7636  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
7637  * try:
7638  * _import_umath()
7639  */
7640 
7641  /* function exit code */
7642  __pyx_r = 0;
7643  goto __pyx_L0;
7644  __pyx_L1_error:;
7645  __Pyx_XDECREF(__pyx_t_5);
7646  __Pyx_XDECREF(__pyx_t_6);
7647  __Pyx_XDECREF(__pyx_t_7);
7648  __Pyx_XDECREF(__pyx_t_8);
7649  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7650  __pyx_r = -1;
7651  __pyx_L0:;
7652  __Pyx_RefNannyFinishContext();
7653  return __pyx_r;
7654 }
7655 
7656 /* "View.MemoryView":122
7657  * cdef bint dtype_is_object
7658  *
7659  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
7660  * mode="c", bint allocate_buffer=True):
7661  *
7662  */
7663 
7664 /* Python wrapper */
7665 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7666 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7667  PyObject *__pyx_v_shape = 0;
7668  Py_ssize_t __pyx_v_itemsize;
7669  PyObject *__pyx_v_format = 0;
7670  PyObject *__pyx_v_mode = 0;
7671  int __pyx_v_allocate_buffer;
7672  int __pyx_lineno = 0;
7673  const char *__pyx_filename = NULL;
7674  int __pyx_clineno = 0;
7675  int __pyx_r;
7676  __Pyx_RefNannyDeclarations
7677  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
7678  {
7679  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
7680  PyObject* values[5] = {0,0,0,0,0};
7681  values[3] = ((PyObject *)__pyx_n_s_c);
7682  if (unlikely(__pyx_kwds)) {
7683  Py_ssize_t kw_args;
7684  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7685  switch (pos_args) {
7686  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7687  CYTHON_FALLTHROUGH;
7688  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7689  CYTHON_FALLTHROUGH;
7690  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7691  CYTHON_FALLTHROUGH;
7692  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7693  CYTHON_FALLTHROUGH;
7694  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7695  CYTHON_FALLTHROUGH;
7696  case 0: break;
7697  default: goto __pyx_L5_argtuple_error;
7698  }
7699  kw_args = PyDict_Size(__pyx_kwds);
7700  switch (pos_args) {
7701  case 0:
7702  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
7703  else goto __pyx_L5_argtuple_error;
7704  CYTHON_FALLTHROUGH;
7705  case 1:
7706  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
7707  else {
7708  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
7709  }
7710  CYTHON_FALLTHROUGH;
7711  case 2:
7712  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
7713  else {
7714  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
7715  }
7716  CYTHON_FALLTHROUGH;
7717  case 3:
7718  if (kw_args > 0) {
7719  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
7720  if (value) { values[3] = value; kw_args--; }
7721  }
7722  CYTHON_FALLTHROUGH;
7723  case 4:
7724  if (kw_args > 0) {
7725  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
7726  if (value) { values[4] = value; kw_args--; }
7727  }
7728  }
7729  if (unlikely(kw_args > 0)) {
7730  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
7731  }
7732  } else {
7733  switch (PyTuple_GET_SIZE(__pyx_args)) {
7734  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7735  CYTHON_FALLTHROUGH;
7736  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7737  CYTHON_FALLTHROUGH;
7738  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7739  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7740  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7741  break;
7742  default: goto __pyx_L5_argtuple_error;
7743  }
7744  }
7745  __pyx_v_shape = ((PyObject*)values[0]);
7746  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
7747  __pyx_v_format = values[2];
7748  __pyx_v_mode = values[3];
7749  if (values[4]) {
7750  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
7751  } else {
7752 
7753  /* "View.MemoryView":123
7754  *
7755  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
7756  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
7757  *
7758  * cdef int idx
7759  */
7760  __pyx_v_allocate_buffer = ((int)1);
7761  }
7762  }
7763  goto __pyx_L4_argument_unpacking_done;
7764  __pyx_L5_argtuple_error:;
7765  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
7766  __pyx_L3_error:;
7767  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7768  __Pyx_RefNannyFinishContext();
7769  return -1;
7770  __pyx_L4_argument_unpacking_done:;
7771  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
7772  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
7773  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error)
7774  }
7775  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
7776 
7777  /* "View.MemoryView":122
7778  * cdef bint dtype_is_object
7779  *
7780  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
7781  * mode="c", bint allocate_buffer=True):
7782  *
7783  */
7784 
7785  /* function exit code */
7786  goto __pyx_L0;
7787  __pyx_L1_error:;
7788  __pyx_r = -1;
7789  __pyx_L0:;
7790  __Pyx_RefNannyFinishContext();
7791  return __pyx_r;
7792 }
7793 
7794 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
7795  int __pyx_v_idx;
7796  Py_ssize_t __pyx_v_i;
7797  Py_ssize_t __pyx_v_dim;
7798  PyObject **__pyx_v_p;
7799  char __pyx_v_order;
7800  int __pyx_r;
7801  __Pyx_RefNannyDeclarations
7802  Py_ssize_t __pyx_t_1;
7803  int __pyx_t_2;
7804  PyObject *__pyx_t_3 = NULL;
7805  int __pyx_t_4;
7806  PyObject *__pyx_t_5 = NULL;
7807  PyObject *__pyx_t_6 = NULL;
7808  char *__pyx_t_7;
7809  int __pyx_t_8;
7810  Py_ssize_t __pyx_t_9;
7811  PyObject *__pyx_t_10 = NULL;
7812  Py_ssize_t __pyx_t_11;
7813  int __pyx_lineno = 0;
7814  const char *__pyx_filename = NULL;
7815  int __pyx_clineno = 0;
7816  __Pyx_RefNannySetupContext("__cinit__", 0);
7817  __Pyx_INCREF(__pyx_v_format);
7818 
7819  /* "View.MemoryView":129
7820  * cdef PyObject **p
7821  *
7822  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
7823  * self.itemsize = itemsize
7824  *
7825  */
7826  if (unlikely(__pyx_v_shape == Py_None)) {
7827  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
7828  __PYX_ERR(1, 129, __pyx_L1_error)
7829  }
7830  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
7831  __pyx_v_self->ndim = ((int)__pyx_t_1);
7832 
7833  /* "View.MemoryView":130
7834  *
7835  * self.ndim = <int> len(shape)
7836  * self.itemsize = itemsize # <<<<<<<<<<<<<<
7837  *
7838  * if not self.ndim:
7839  */
7840  __pyx_v_self->itemsize = __pyx_v_itemsize;
7841 
7842  /* "View.MemoryView":132
7843  * self.itemsize = itemsize
7844  *
7845  * if not self.ndim: # <<<<<<<<<<<<<<
7846  * raise ValueError("Empty shape tuple for cython.array")
7847  *
7848  */
7849  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
7850  if (unlikely(__pyx_t_2)) {
7851 
7852  /* "View.MemoryView":133
7853  *
7854  * if not self.ndim:
7855  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
7856  *
7857  * if itemsize <= 0:
7858  */
7859  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
7860  __Pyx_GOTREF(__pyx_t_3);
7861  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7862  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7863  __PYX_ERR(1, 133, __pyx_L1_error)
7864 
7865  /* "View.MemoryView":132
7866  * self.itemsize = itemsize
7867  *
7868  * if not self.ndim: # <<<<<<<<<<<<<<
7869  * raise ValueError("Empty shape tuple for cython.array")
7870  *
7871  */
7872  }
7873 
7874  /* "View.MemoryView":135
7875  * raise ValueError("Empty shape tuple for cython.array")
7876  *
7877  * if itemsize <= 0: # <<<<<<<<<<<<<<
7878  * raise ValueError("itemsize <= 0 for cython.array")
7879  *
7880  */
7881  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
7882  if (unlikely(__pyx_t_2)) {
7883 
7884  /* "View.MemoryView":136
7885  *
7886  * if itemsize <= 0:
7887  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
7888  *
7889  * if not isinstance(format, bytes):
7890  */
7891  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
7892  __Pyx_GOTREF(__pyx_t_3);
7893  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7894  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7895  __PYX_ERR(1, 136, __pyx_L1_error)
7896 
7897  /* "View.MemoryView":135
7898  * raise ValueError("Empty shape tuple for cython.array")
7899  *
7900  * if itemsize <= 0: # <<<<<<<<<<<<<<
7901  * raise ValueError("itemsize <= 0 for cython.array")
7902  *
7903  */
7904  }
7905 
7906  /* "View.MemoryView":138
7907  * raise ValueError("itemsize <= 0 for cython.array")
7908  *
7909  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
7910  * format = format.encode('ASCII')
7911  * self._format = format # keep a reference to the byte string
7912  */
7913  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
7914  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
7915  if (__pyx_t_4) {
7916 
7917  /* "View.MemoryView":139
7918  *
7919  * if not isinstance(format, bytes):
7920  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
7921  * self._format = format # keep a reference to the byte string
7922  * self.format = self._format
7923  */
7924  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
7925  __Pyx_GOTREF(__pyx_t_5);
7926  __pyx_t_6 = NULL;
7927  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
7928  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
7929  if (likely(__pyx_t_6)) {
7930  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
7931  __Pyx_INCREF(__pyx_t_6);
7932  __Pyx_INCREF(function);
7933  __Pyx_DECREF_SET(__pyx_t_5, function);
7934  }
7935  }
7936  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
7937  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7938  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
7939  __Pyx_GOTREF(__pyx_t_3);
7940  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7941  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
7942  __pyx_t_3 = 0;
7943 
7944  /* "View.MemoryView":138
7945  * raise ValueError("itemsize <= 0 for cython.array")
7946  *
7947  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
7948  * format = format.encode('ASCII')
7949  * self._format = format # keep a reference to the byte string
7950  */
7951  }
7952 
7953  /* "View.MemoryView":140
7954  * if not isinstance(format, bytes):
7955  * format = format.encode('ASCII')
7956  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
7957  * self.format = self._format
7958  *
7959  */
7960  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
7961  __pyx_t_3 = __pyx_v_format;
7962  __Pyx_INCREF(__pyx_t_3);
7963  __Pyx_GIVEREF(__pyx_t_3);
7964  __Pyx_GOTREF(__pyx_v_self->_format);
7965  __Pyx_DECREF(__pyx_v_self->_format);
7966  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
7967  __pyx_t_3 = 0;
7968 
7969  /* "View.MemoryView":141
7970  * format = format.encode('ASCII')
7971  * self._format = format # keep a reference to the byte string
7972  * self.format = self._format # <<<<<<<<<<<<<<
7973  *
7974  *
7975  */
7976  if (unlikely(__pyx_v_self->_format == Py_None)) {
7977  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
7978  __PYX_ERR(1, 141, __pyx_L1_error)
7979  }
7980  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
7981  __pyx_v_self->format = __pyx_t_7;
7982 
7983  /* "View.MemoryView":144
7984  *
7985  *
7986  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
7987  * self._strides = self._shape + self.ndim
7988  *
7989  */
7990  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
7991 
7992  /* "View.MemoryView":145
7993  *
7994  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
7995  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
7996  *
7997  * if not self._shape:
7998  */
7999  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8000 
8001  /* "View.MemoryView":147
8002  * self._strides = self._shape + self.ndim
8003  *
8004  * if not self._shape: # <<<<<<<<<<<<<<
8005  * raise MemoryError("unable to allocate shape and strides.")
8006  *
8007  */
8008  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8009  if (unlikely(__pyx_t_4)) {
8010 
8011  /* "View.MemoryView":148
8012  *
8013  * if not self._shape:
8014  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
8015  *
8016  *
8017  */
8018  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
8019  __Pyx_GOTREF(__pyx_t_3);
8020  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8021  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8022  __PYX_ERR(1, 148, __pyx_L1_error)
8023 
8024  /* "View.MemoryView":147
8025  * self._strides = self._shape + self.ndim
8026  *
8027  * if not self._shape: # <<<<<<<<<<<<<<
8028  * raise MemoryError("unable to allocate shape and strides.")
8029  *
8030  */
8031  }
8032 
8033  /* "View.MemoryView":151
8034  *
8035  *
8036  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8037  * if dim <= 0:
8038  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8039  */
8040  __pyx_t_8 = 0;
8041  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
8042  for (;;) {
8043  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
8044  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8045  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
8046  #else
8047  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
8048  __Pyx_GOTREF(__pyx_t_5);
8049  #endif
8050  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
8051  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8052  __pyx_v_dim = __pyx_t_9;
8053  __pyx_v_idx = __pyx_t_8;
8054  __pyx_t_8 = (__pyx_t_8 + 1);
8055 
8056  /* "View.MemoryView":152
8057  *
8058  * for idx, dim in enumerate(shape):
8059  * if dim <= 0: # <<<<<<<<<<<<<<
8060  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8061  * self._shape[idx] = dim
8062  */
8063  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8064  if (unlikely(__pyx_t_4)) {
8065 
8066  /* "View.MemoryView":153
8067  * for idx, dim in enumerate(shape):
8068  * if dim <= 0:
8069  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
8070  * self._shape[idx] = dim
8071  *
8072  */
8073  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
8074  __Pyx_GOTREF(__pyx_t_5);
8075  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
8076  __Pyx_GOTREF(__pyx_t_6);
8077  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
8078  __Pyx_GOTREF(__pyx_t_10);
8079  __Pyx_GIVEREF(__pyx_t_5);
8080  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
8081  __Pyx_GIVEREF(__pyx_t_6);
8082  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
8083  __pyx_t_5 = 0;
8084  __pyx_t_6 = 0;
8085  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
8086  __Pyx_GOTREF(__pyx_t_6);
8087  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8088  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
8089  __Pyx_GOTREF(__pyx_t_10);
8090  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8091  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8092  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8093  __PYX_ERR(1, 153, __pyx_L1_error)
8094 
8095  /* "View.MemoryView":152
8096  *
8097  * for idx, dim in enumerate(shape):
8098  * if dim <= 0: # <<<<<<<<<<<<<<
8099  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8100  * self._shape[idx] = dim
8101  */
8102  }
8103 
8104  /* "View.MemoryView":154
8105  * if dim <= 0:
8106  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8107  * self._shape[idx] = dim # <<<<<<<<<<<<<<
8108  *
8109  * cdef char order
8110  */
8111  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
8112 
8113  /* "View.MemoryView":151
8114  *
8115  *
8116  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8117  * if dim <= 0:
8118  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8119  */
8120  }
8121  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8122 
8123  /* "View.MemoryView":157
8124  *
8125  * cdef char order
8126  * if mode == 'fortran': # <<<<<<<<<<<<<<
8127  * order = b'F'
8128  * self.mode = u'fortran'
8129  */
8130  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
8131  if (__pyx_t_4) {
8132 
8133  /* "View.MemoryView":158
8134  * cdef char order
8135  * if mode == 'fortran':
8136  * order = b'F' # <<<<<<<<<<<<<<
8137  * self.mode = u'fortran'
8138  * elif mode == 'c':
8139  */
8140  __pyx_v_order = 'F';
8141 
8142  /* "View.MemoryView":159
8143  * if mode == 'fortran':
8144  * order = b'F'
8145  * self.mode = u'fortran' # <<<<<<<<<<<<<<
8146  * elif mode == 'c':
8147  * order = b'C'
8148  */
8149  __Pyx_INCREF(__pyx_n_u_fortran);
8150  __Pyx_GIVEREF(__pyx_n_u_fortran);
8151  __Pyx_GOTREF(__pyx_v_self->mode);
8152  __Pyx_DECREF(__pyx_v_self->mode);
8153  __pyx_v_self->mode = __pyx_n_u_fortran;
8154 
8155  /* "View.MemoryView":157
8156  *
8157  * cdef char order
8158  * if mode == 'fortran': # <<<<<<<<<<<<<<
8159  * order = b'F'
8160  * self.mode = u'fortran'
8161  */
8162  goto __pyx_L10;
8163  }
8164 
8165  /* "View.MemoryView":160
8166  * order = b'F'
8167  * self.mode = u'fortran'
8168  * elif mode == 'c': # <<<<<<<<<<<<<<
8169  * order = b'C'
8170  * self.mode = u'c'
8171  */
8172  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
8173  if (likely(__pyx_t_4)) {
8174 
8175  /* "View.MemoryView":161
8176  * self.mode = u'fortran'
8177  * elif mode == 'c':
8178  * order = b'C' # <<<<<<<<<<<<<<
8179  * self.mode = u'c'
8180  * else:
8181  */
8182  __pyx_v_order = 'C';
8183 
8184  /* "View.MemoryView":162
8185  * elif mode == 'c':
8186  * order = b'C'
8187  * self.mode = u'c' # <<<<<<<<<<<<<<
8188  * else:
8189  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8190  */
8191  __Pyx_INCREF(__pyx_n_u_c);
8192  __Pyx_GIVEREF(__pyx_n_u_c);
8193  __Pyx_GOTREF(__pyx_v_self->mode);
8194  __Pyx_DECREF(__pyx_v_self->mode);
8195  __pyx_v_self->mode = __pyx_n_u_c;
8196 
8197  /* "View.MemoryView":160
8198  * order = b'F'
8199  * self.mode = u'fortran'
8200  * elif mode == 'c': # <<<<<<<<<<<<<<
8201  * order = b'C'
8202  * self.mode = u'c'
8203  */
8204  goto __pyx_L10;
8205  }
8206 
8207  /* "View.MemoryView":164
8208  * self.mode = u'c'
8209  * else:
8210  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
8211  *
8212  * self.len = fill_contig_strides_array(self._shape, self._strides,
8213  */
8214  /*else*/ {
8215  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
8216  __Pyx_GOTREF(__pyx_t_3);
8217  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
8218  __Pyx_GOTREF(__pyx_t_10);
8219  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8220  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8221  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8222  __PYX_ERR(1, 164, __pyx_L1_error)
8223  }
8224  __pyx_L10:;
8225 
8226  /* "View.MemoryView":166
8227  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8228  *
8229  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
8230  * itemsize, self.ndim, order)
8231  *
8232  */
8233  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
8234 
8235  /* "View.MemoryView":169
8236  * itemsize, self.ndim, order)
8237  *
8238  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
8239  * self.dtype_is_object = format == b'O'
8240  * if allocate_buffer:
8241  */
8242  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
8243 
8244  /* "View.MemoryView":170
8245  *
8246  * self.free_data = allocate_buffer
8247  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
8248  * if allocate_buffer:
8249  *
8250  */
8251  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
8252  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
8253  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8254  __pyx_v_self->dtype_is_object = __pyx_t_4;
8255 
8256  /* "View.MemoryView":171
8257  * self.free_data = allocate_buffer
8258  * self.dtype_is_object = format == b'O'
8259  * if allocate_buffer: # <<<<<<<<<<<<<<
8260  *
8261  *
8262  */
8263  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
8264  if (__pyx_t_4) {
8265 
8266  /* "View.MemoryView":174
8267  *
8268  *
8269  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
8270  * if not self.data:
8271  * raise MemoryError("unable to allocate array data.")
8272  */
8273  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
8274 
8275  /* "View.MemoryView":175
8276  *
8277  * self.data = <char *>malloc(self.len)
8278  * if not self.data: # <<<<<<<<<<<<<<
8279  * raise MemoryError("unable to allocate array data.")
8280  *
8281  */
8282  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
8283  if (unlikely(__pyx_t_4)) {
8284 
8285  /* "View.MemoryView":176
8286  * self.data = <char *>malloc(self.len)
8287  * if not self.data:
8288  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
8289  *
8290  * if self.dtype_is_object:
8291  */
8292  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
8293  __Pyx_GOTREF(__pyx_t_10);
8294  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8295  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8296  __PYX_ERR(1, 176, __pyx_L1_error)
8297 
8298  /* "View.MemoryView":175
8299  *
8300  * self.data = <char *>malloc(self.len)
8301  * if not self.data: # <<<<<<<<<<<<<<
8302  * raise MemoryError("unable to allocate array data.")
8303  *
8304  */
8305  }
8306 
8307  /* "View.MemoryView":178
8308  * raise MemoryError("unable to allocate array data.")
8309  *
8310  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8311  * p = <PyObject **> self.data
8312  * for i in range(self.len / itemsize):
8313  */
8314  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
8315  if (__pyx_t_4) {
8316 
8317  /* "View.MemoryView":179
8318  *
8319  * if self.dtype_is_object:
8320  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
8321  * for i in range(self.len / itemsize):
8322  * p[i] = Py_None
8323  */
8324  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
8325 
8326  /* "View.MemoryView":180
8327  * if self.dtype_is_object:
8328  * p = <PyObject **> self.data
8329  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
8330  * p[i] = Py_None
8331  * Py_INCREF(Py_None)
8332  */
8333  if (unlikely(__pyx_v_itemsize == 0)) {
8334  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
8335  __PYX_ERR(1, 180, __pyx_L1_error)
8336  }
8337  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
8338  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
8339  __PYX_ERR(1, 180, __pyx_L1_error)
8340  }
8341  __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
8342  __pyx_t_9 = __pyx_t_1;
8343  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
8344  __pyx_v_i = __pyx_t_11;
8345 
8346  /* "View.MemoryView":181
8347  * p = <PyObject **> self.data
8348  * for i in range(self.len / itemsize):
8349  * p[i] = Py_None # <<<<<<<<<<<<<<
8350  * Py_INCREF(Py_None)
8351  *
8352  */
8353  (__pyx_v_p[__pyx_v_i]) = Py_None;
8354 
8355  /* "View.MemoryView":182
8356  * for i in range(self.len / itemsize):
8357  * p[i] = Py_None
8358  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
8359  *
8360  * @cname('getbuffer')
8361  */
8362  Py_INCREF(Py_None);
8363  }
8364 
8365  /* "View.MemoryView":178
8366  * raise MemoryError("unable to allocate array data.")
8367  *
8368  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8369  * p = <PyObject **> self.data
8370  * for i in range(self.len / itemsize):
8371  */
8372  }
8373 
8374  /* "View.MemoryView":171
8375  * self.free_data = allocate_buffer
8376  * self.dtype_is_object = format == b'O'
8377  * if allocate_buffer: # <<<<<<<<<<<<<<
8378  *
8379  *
8380  */
8381  }
8382 
8383  /* "View.MemoryView":122
8384  * cdef bint dtype_is_object
8385  *
8386  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8387  * mode="c", bint allocate_buffer=True):
8388  *
8389  */
8390 
8391  /* function exit code */
8392  __pyx_r = 0;
8393  goto __pyx_L0;
8394  __pyx_L1_error:;
8395  __Pyx_XDECREF(__pyx_t_3);
8396  __Pyx_XDECREF(__pyx_t_5);
8397  __Pyx_XDECREF(__pyx_t_6);
8398  __Pyx_XDECREF(__pyx_t_10);
8399  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8400  __pyx_r = -1;
8401  __pyx_L0:;
8402  __Pyx_XDECREF(__pyx_v_format);
8403  __Pyx_RefNannyFinishContext();
8404  return __pyx_r;
8405 }
8406 
8407 /* "View.MemoryView":185
8408  *
8409  * @cname('getbuffer')
8410  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
8411  * cdef int bufmode = -1
8412  * if self.mode == u"c":
8413  */
8414 
8415 /* Python wrapper */
8416 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
8417 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
8418  int __pyx_r;
8419  __Pyx_RefNannyDeclarations
8420  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
8421  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
8422 
8423  /* function exit code */
8424  __Pyx_RefNannyFinishContext();
8425  return __pyx_r;
8426 }
8427 
8428 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
8429  int __pyx_v_bufmode;
8430  int __pyx_r;
8431  __Pyx_RefNannyDeclarations
8432  int __pyx_t_1;
8433  int __pyx_t_2;
8434  PyObject *__pyx_t_3 = NULL;
8435  char *__pyx_t_4;
8436  Py_ssize_t __pyx_t_5;
8437  int __pyx_t_6;
8438  Py_ssize_t *__pyx_t_7;
8439  int __pyx_lineno = 0;
8440  const char *__pyx_filename = NULL;
8441  int __pyx_clineno = 0;
8442  if (__pyx_v_info == NULL) {
8443  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
8444  return -1;
8445  }
8446  __Pyx_RefNannySetupContext("__getbuffer__", 0);
8447  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
8448  __Pyx_GIVEREF(__pyx_v_info->obj);
8449 
8450  /* "View.MemoryView":186
8451  * @cname('getbuffer')
8452  * def __getbuffer__(self, Py_buffer *info, int flags):
8453  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
8454  * if self.mode == u"c":
8455  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8456  */
8457  __pyx_v_bufmode = -1;
8458 
8459  /* "View.MemoryView":187
8460  * def __getbuffer__(self, Py_buffer *info, int flags):
8461  * cdef int bufmode = -1
8462  * if self.mode == u"c": # <<<<<<<<<<<<<<
8463  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8464  * elif self.mode == u"fortran":
8465  */
8466  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
8467  __pyx_t_2 = (__pyx_t_1 != 0);
8468  if (__pyx_t_2) {
8469 
8470  /* "View.MemoryView":188
8471  * cdef int bufmode = -1
8472  * if self.mode == u"c":
8473  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
8474  * elif self.mode == u"fortran":
8475  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8476  */
8477  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8478 
8479  /* "View.MemoryView":187
8480  * def __getbuffer__(self, Py_buffer *info, int flags):
8481  * cdef int bufmode = -1
8482  * if self.mode == u"c": # <<<<<<<<<<<<<<
8483  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8484  * elif self.mode == u"fortran":
8485  */
8486  goto __pyx_L3;
8487  }
8488 
8489  /* "View.MemoryView":189
8490  * if self.mode == u"c":
8491  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8492  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
8493  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8494  * if not (flags & bufmode):
8495  */
8496  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
8497  __pyx_t_1 = (__pyx_t_2 != 0);
8498  if (__pyx_t_1) {
8499 
8500  /* "View.MemoryView":190
8501  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8502  * elif self.mode == u"fortran":
8503  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
8504  * if not (flags & bufmode):
8505  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8506  */
8507  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8508 
8509  /* "View.MemoryView":189
8510  * if self.mode == u"c":
8511  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8512  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
8513  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8514  * if not (flags & bufmode):
8515  */
8516  }
8517  __pyx_L3:;
8518 
8519  /* "View.MemoryView":191
8520  * elif self.mode == u"fortran":
8521  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8522  * if not (flags & bufmode): # <<<<<<<<<<<<<<
8523  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8524  * info.buf = self.data
8525  */
8526  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
8527  if (unlikely(__pyx_t_1)) {
8528 
8529  /* "View.MemoryView":192
8530  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8531  * if not (flags & bufmode):
8532  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
8533  * info.buf = self.data
8534  * info.len = self.len
8535  */
8536  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
8537  __Pyx_GOTREF(__pyx_t_3);
8538  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8539  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8540  __PYX_ERR(1, 192, __pyx_L1_error)
8541 
8542  /* "View.MemoryView":191
8543  * elif self.mode == u"fortran":
8544  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8545  * if not (flags & bufmode): # <<<<<<<<<<<<<<
8546  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8547  * info.buf = self.data
8548  */
8549  }
8550 
8551  /* "View.MemoryView":193
8552  * if not (flags & bufmode):
8553  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8554  * info.buf = self.data # <<<<<<<<<<<<<<
8555  * info.len = self.len
8556  * info.ndim = self.ndim
8557  */
8558  __pyx_t_4 = __pyx_v_self->data;
8559  __pyx_v_info->buf = __pyx_t_4;
8560 
8561  /* "View.MemoryView":194
8562  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8563  * info.buf = self.data
8564  * info.len = self.len # <<<<<<<<<<<<<<
8565  * info.ndim = self.ndim
8566  * info.shape = self._shape
8567  */
8568  __pyx_t_5 = __pyx_v_self->len;
8569  __pyx_v_info->len = __pyx_t_5;
8570 
8571  /* "View.MemoryView":195
8572  * info.buf = self.data
8573  * info.len = self.len
8574  * info.ndim = self.ndim # <<<<<<<<<<<<<<
8575  * info.shape = self._shape
8576  * info.strides = self._strides
8577  */
8578  __pyx_t_6 = __pyx_v_self->ndim;
8579  __pyx_v_info->ndim = __pyx_t_6;
8580 
8581  /* "View.MemoryView":196
8582  * info.len = self.len
8583  * info.ndim = self.ndim
8584  * info.shape = self._shape # <<<<<<<<<<<<<<
8585  * info.strides = self._strides
8586  * info.suboffsets = NULL
8587  */
8588  __pyx_t_7 = __pyx_v_self->_shape;
8589  __pyx_v_info->shape = __pyx_t_7;
8590 
8591  /* "View.MemoryView":197
8592  * info.ndim = self.ndim
8593  * info.shape = self._shape
8594  * info.strides = self._strides # <<<<<<<<<<<<<<
8595  * info.suboffsets = NULL
8596  * info.itemsize = self.itemsize
8597  */
8598  __pyx_t_7 = __pyx_v_self->_strides;
8599  __pyx_v_info->strides = __pyx_t_7;
8600 
8601  /* "View.MemoryView":198
8602  * info.shape = self._shape
8603  * info.strides = self._strides
8604  * info.suboffsets = NULL # <<<<<<<<<<<<<<
8605  * info.itemsize = self.itemsize
8606  * info.readonly = 0
8607  */
8608  __pyx_v_info->suboffsets = NULL;
8609 
8610  /* "View.MemoryView":199
8611  * info.strides = self._strides
8612  * info.suboffsets = NULL
8613  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
8614  * info.readonly = 0
8615  *
8616  */
8617  __pyx_t_5 = __pyx_v_self->itemsize;
8618  __pyx_v_info->itemsize = __pyx_t_5;
8619 
8620  /* "View.MemoryView":200
8621  * info.suboffsets = NULL
8622  * info.itemsize = self.itemsize
8623  * info.readonly = 0 # <<<<<<<<<<<<<<
8624  *
8625  * if flags & PyBUF_FORMAT:
8626  */
8627  __pyx_v_info->readonly = 0;
8628 
8629  /* "View.MemoryView":202
8630  * info.readonly = 0
8631  *
8632  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8633  * info.format = self.format
8634  * else:
8635  */
8636  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8637  if (__pyx_t_1) {
8638 
8639  /* "View.MemoryView":203
8640  *
8641  * if flags & PyBUF_FORMAT:
8642  * info.format = self.format # <<<<<<<<<<<<<<
8643  * else:
8644  * info.format = NULL
8645  */
8646  __pyx_t_4 = __pyx_v_self->format;
8647  __pyx_v_info->format = __pyx_t_4;
8648 
8649  /* "View.MemoryView":202
8650  * info.readonly = 0
8651  *
8652  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8653  * info.format = self.format
8654  * else:
8655  */
8656  goto __pyx_L5;
8657  }
8658 
8659  /* "View.MemoryView":205
8660  * info.format = self.format
8661  * else:
8662  * info.format = NULL # <<<<<<<<<<<<<<
8663  *
8664  * info.obj = self
8665  */
8666  /*else*/ {
8667  __pyx_v_info->format = NULL;
8668  }
8669  __pyx_L5:;
8670 
8671  /* "View.MemoryView":207
8672  * info.format = NULL
8673  *
8674  * info.obj = self # <<<<<<<<<<<<<<
8675  *
8676  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8677  */
8678  __Pyx_INCREF(((PyObject *)__pyx_v_self));
8679  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8680  __Pyx_GOTREF(__pyx_v_info->obj);
8681  __Pyx_DECREF(__pyx_v_info->obj);
8682  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
8683 
8684  /* "View.MemoryView":185
8685  *
8686  * @cname('getbuffer')
8687  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
8688  * cdef int bufmode = -1
8689  * if self.mode == u"c":
8690  */
8691 
8692  /* function exit code */
8693  __pyx_r = 0;
8694  goto __pyx_L0;
8695  __pyx_L1_error:;
8696  __Pyx_XDECREF(__pyx_t_3);
8697  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8698  __pyx_r = -1;
8699  if (__pyx_v_info->obj != NULL) {
8700  __Pyx_GOTREF(__pyx_v_info->obj);
8701  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8702  }
8703  goto __pyx_L2;
8704  __pyx_L0:;
8705  if (__pyx_v_info->obj == Py_None) {
8706  __Pyx_GOTREF(__pyx_v_info->obj);
8707  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8708  }
8709  __pyx_L2:;
8710  __Pyx_RefNannyFinishContext();
8711  return __pyx_r;
8712 }
8713 
8714 /* "View.MemoryView":211
8715  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8716  *
8717  * def __dealloc__(array self): # <<<<<<<<<<<<<<
8718  * if self.callback_free_data != NULL:
8719  * self.callback_free_data(self.data)
8720  */
8721 
8722 /* Python wrapper */
8723 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
8724 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
8725  __Pyx_RefNannyDeclarations
8726  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
8727  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
8728 
8729  /* function exit code */
8730  __Pyx_RefNannyFinishContext();
8731 }
8732 
8733 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
8734  __Pyx_RefNannyDeclarations
8735  int __pyx_t_1;
8736  __Pyx_RefNannySetupContext("__dealloc__", 0);
8737 
8738  /* "View.MemoryView":212
8739  *
8740  * def __dealloc__(array self):
8741  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
8742  * self.callback_free_data(self.data)
8743  * elif self.free_data:
8744  */
8745  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
8746  if (__pyx_t_1) {
8747 
8748  /* "View.MemoryView":213
8749  * def __dealloc__(array self):
8750  * if self.callback_free_data != NULL:
8751  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
8752  * elif self.free_data:
8753  * if self.dtype_is_object:
8754  */
8755  __pyx_v_self->callback_free_data(__pyx_v_self->data);
8756 
8757  /* "View.MemoryView":212
8758  *
8759  * def __dealloc__(array self):
8760  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
8761  * self.callback_free_data(self.data)
8762  * elif self.free_data:
8763  */
8764  goto __pyx_L3;
8765  }
8766 
8767  /* "View.MemoryView":214
8768  * if self.callback_free_data != NULL:
8769  * self.callback_free_data(self.data)
8770  * elif self.free_data: # <<<<<<<<<<<<<<
8771  * if self.dtype_is_object:
8772  * refcount_objects_in_slice(self.data, self._shape,
8773  */
8774  __pyx_t_1 = (__pyx_v_self->free_data != 0);
8775  if (__pyx_t_1) {
8776 
8777  /* "View.MemoryView":215
8778  * self.callback_free_data(self.data)
8779  * elif self.free_data:
8780  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8781  * refcount_objects_in_slice(self.data, self._shape,
8782  * self._strides, self.ndim, False)
8783  */
8784  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
8785  if (__pyx_t_1) {
8786 
8787  /* "View.MemoryView":216
8788  * elif self.free_data:
8789  * if self.dtype_is_object:
8790  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
8791  * self._strides, self.ndim, False)
8792  * free(self.data)
8793  */
8794  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
8795 
8796  /* "View.MemoryView":215
8797  * self.callback_free_data(self.data)
8798  * elif self.free_data:
8799  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8800  * refcount_objects_in_slice(self.data, self._shape,
8801  * self._strides, self.ndim, False)
8802  */
8803  }
8804 
8805  /* "View.MemoryView":218
8806  * refcount_objects_in_slice(self.data, self._shape,
8807  * self._strides, self.ndim, False)
8808  * free(self.data) # <<<<<<<<<<<<<<
8809  * PyObject_Free(self._shape)
8810  *
8811  */
8812  free(__pyx_v_self->data);
8813 
8814  /* "View.MemoryView":214
8815  * if self.callback_free_data != NULL:
8816  * self.callback_free_data(self.data)
8817  * elif self.free_data: # <<<<<<<<<<<<<<
8818  * if self.dtype_is_object:
8819  * refcount_objects_in_slice(self.data, self._shape,
8820  */
8821  }
8822  __pyx_L3:;
8823 
8824  /* "View.MemoryView":219
8825  * self._strides, self.ndim, False)
8826  * free(self.data)
8827  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
8828  *
8829  * @property
8830  */
8831  PyObject_Free(__pyx_v_self->_shape);
8832 
8833  /* "View.MemoryView":211
8834  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8835  *
8836  * def __dealloc__(array self): # <<<<<<<<<<<<<<
8837  * if self.callback_free_data != NULL:
8838  * self.callback_free_data(self.data)
8839  */
8840 
8841  /* function exit code */
8842  __Pyx_RefNannyFinishContext();
8843 }
8844 
8845 /* "View.MemoryView":222
8846  *
8847  * @property
8848  * def memview(self): # <<<<<<<<<<<<<<
8849  * return self.get_memview()
8850  *
8851  */
8852 
8853 /* Python wrapper */
8854 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
8855 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
8856  PyObject *__pyx_r = 0;
8857  __Pyx_RefNannyDeclarations
8858  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
8859  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
8860 
8861  /* function exit code */
8862  __Pyx_RefNannyFinishContext();
8863  return __pyx_r;
8864 }
8865 
8866 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
8867  PyObject *__pyx_r = NULL;
8868  __Pyx_RefNannyDeclarations
8869  PyObject *__pyx_t_1 = NULL;
8870  int __pyx_lineno = 0;
8871  const char *__pyx_filename = NULL;
8872  int __pyx_clineno = 0;
8873  __Pyx_RefNannySetupContext("__get__", 0);
8874 
8875  /* "View.MemoryView":223
8876  * @property
8877  * def memview(self):
8878  * return self.get_memview() # <<<<<<<<<<<<<<
8879  *
8880  * @cname('get_memview')
8881  */
8882  __Pyx_XDECREF(__pyx_r);
8883  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
8884  __Pyx_GOTREF(__pyx_t_1);
8885  __pyx_r = __pyx_t_1;
8886  __pyx_t_1 = 0;
8887  goto __pyx_L0;
8888 
8889  /* "View.MemoryView":222
8890  *
8891  * @property
8892  * def memview(self): # <<<<<<<<<<<<<<
8893  * return self.get_memview()
8894  *
8895  */
8896 
8897  /* function exit code */
8898  __pyx_L1_error:;
8899  __Pyx_XDECREF(__pyx_t_1);
8900  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8901  __pyx_r = NULL;
8902  __pyx_L0:;
8903  __Pyx_XGIVEREF(__pyx_r);
8904  __Pyx_RefNannyFinishContext();
8905  return __pyx_r;
8906 }
8907 
8908 /* "View.MemoryView":226
8909  *
8910  * @cname('get_memview')
8911  * cdef get_memview(self): # <<<<<<<<<<<<<<
8912  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8913  * return memoryview(self, flags, self.dtype_is_object)
8914  */
8915 
8916 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
8917  int __pyx_v_flags;
8918  PyObject *__pyx_r = NULL;
8919  __Pyx_RefNannyDeclarations
8920  PyObject *__pyx_t_1 = NULL;
8921  PyObject *__pyx_t_2 = NULL;
8922  PyObject *__pyx_t_3 = NULL;
8923  int __pyx_lineno = 0;
8924  const char *__pyx_filename = NULL;
8925  int __pyx_clineno = 0;
8926  __Pyx_RefNannySetupContext("get_memview", 0);
8927 
8928  /* "View.MemoryView":227
8929  * @cname('get_memview')
8930  * cdef get_memview(self):
8931  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
8932  * return memoryview(self, flags, self.dtype_is_object)
8933  *
8934  */
8935  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
8936 
8937  /* "View.MemoryView":228
8938  * cdef get_memview(self):
8939  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8940  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
8941  *
8942  * def __len__(self):
8943  */
8944  __Pyx_XDECREF(__pyx_r);
8945  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
8946  __Pyx_GOTREF(__pyx_t_1);
8947  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
8948  __Pyx_GOTREF(__pyx_t_2);
8949  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
8950  __Pyx_GOTREF(__pyx_t_3);
8951  __Pyx_INCREF(((PyObject *)__pyx_v_self));
8952  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8953  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
8954  __Pyx_GIVEREF(__pyx_t_1);
8955  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
8956  __Pyx_GIVEREF(__pyx_t_2);
8957  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
8958  __pyx_t_1 = 0;
8959  __pyx_t_2 = 0;
8960  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
8961  __Pyx_GOTREF(__pyx_t_2);
8962  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8963  __pyx_r = __pyx_t_2;
8964  __pyx_t_2 = 0;
8965  goto __pyx_L0;
8966 
8967  /* "View.MemoryView":226
8968  *
8969  * @cname('get_memview')
8970  * cdef get_memview(self): # <<<<<<<<<<<<<<
8971  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8972  * return memoryview(self, flags, self.dtype_is_object)
8973  */
8974 
8975  /* function exit code */
8976  __pyx_L1_error:;
8977  __Pyx_XDECREF(__pyx_t_1);
8978  __Pyx_XDECREF(__pyx_t_2);
8979  __Pyx_XDECREF(__pyx_t_3);
8980  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
8981  __pyx_r = 0;
8982  __pyx_L0:;
8983  __Pyx_XGIVEREF(__pyx_r);
8984  __Pyx_RefNannyFinishContext();
8985  return __pyx_r;
8986 }
8987 
8988 /* "View.MemoryView":230
8989  * return memoryview(self, flags, self.dtype_is_object)
8990  *
8991  * def __len__(self): # <<<<<<<<<<<<<<
8992  * return self._shape[0]
8993  *
8994  */
8995 
8996 /* Python wrapper */
8997 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
8998 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
8999  Py_ssize_t __pyx_r;
9000  __Pyx_RefNannyDeclarations
9001  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
9002  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
9003 
9004  /* function exit code */
9005  __Pyx_RefNannyFinishContext();
9006  return __pyx_r;
9007 }
9008 
9009 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
9010  Py_ssize_t __pyx_r;
9011  __Pyx_RefNannyDeclarations
9012  __Pyx_RefNannySetupContext("__len__", 0);
9013 
9014  /* "View.MemoryView":231
9015  *
9016  * def __len__(self):
9017  * return self._shape[0] # <<<<<<<<<<<<<<
9018  *
9019  * def __getattr__(self, attr):
9020  */
9021  __pyx_r = (__pyx_v_self->_shape[0]);
9022  goto __pyx_L0;
9023 
9024  /* "View.MemoryView":230
9025  * return memoryview(self, flags, self.dtype_is_object)
9026  *
9027  * def __len__(self): # <<<<<<<<<<<<<<
9028  * return self._shape[0]
9029  *
9030  */
9031 
9032  /* function exit code */
9033  __pyx_L0:;
9034  __Pyx_RefNannyFinishContext();
9035  return __pyx_r;
9036 }
9037 
9038 /* "View.MemoryView":233
9039  * return self._shape[0]
9040  *
9041  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9042  * return getattr(self.memview, attr)
9043  *
9044  */
9045 
9046 /* Python wrapper */
9047 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
9048 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9049  PyObject *__pyx_r = 0;
9050  __Pyx_RefNannyDeclarations
9051  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
9052  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9053 
9054  /* function exit code */
9055  __Pyx_RefNannyFinishContext();
9056  return __pyx_r;
9057 }
9058 
9059 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9060  PyObject *__pyx_r = NULL;
9061  __Pyx_RefNannyDeclarations
9062  PyObject *__pyx_t_1 = NULL;
9063  PyObject *__pyx_t_2 = NULL;
9064  int __pyx_lineno = 0;
9065  const char *__pyx_filename = NULL;
9066  int __pyx_clineno = 0;
9067  __Pyx_RefNannySetupContext("__getattr__", 0);
9068 
9069  /* "View.MemoryView":234
9070  *
9071  * def __getattr__(self, attr):
9072  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
9073  *
9074  * def __getitem__(self, item):
9075  */
9076  __Pyx_XDECREF(__pyx_r);
9077  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
9078  __Pyx_GOTREF(__pyx_t_1);
9079  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
9080  __Pyx_GOTREF(__pyx_t_2);
9081  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9082  __pyx_r = __pyx_t_2;
9083  __pyx_t_2 = 0;
9084  goto __pyx_L0;
9085 
9086  /* "View.MemoryView":233
9087  * return self._shape[0]
9088  *
9089  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9090  * return getattr(self.memview, attr)
9091  *
9092  */
9093 
9094  /* function exit code */
9095  __pyx_L1_error:;
9096  __Pyx_XDECREF(__pyx_t_1);
9097  __Pyx_XDECREF(__pyx_t_2);
9098  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9099  __pyx_r = NULL;
9100  __pyx_L0:;
9101  __Pyx_XGIVEREF(__pyx_r);
9102  __Pyx_RefNannyFinishContext();
9103  return __pyx_r;
9104 }
9105 
9106 /* "View.MemoryView":236
9107  * return getattr(self.memview, attr)
9108  *
9109  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9110  * return self.memview[item]
9111  *
9112  */
9113 
9114 /* Python wrapper */
9115 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
9116 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
9117  PyObject *__pyx_r = 0;
9118  __Pyx_RefNannyDeclarations
9119  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
9120  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
9121 
9122  /* function exit code */
9123  __Pyx_RefNannyFinishContext();
9124  return __pyx_r;
9125 }
9126 
9127 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
9128  PyObject *__pyx_r = NULL;
9129  __Pyx_RefNannyDeclarations
9130  PyObject *__pyx_t_1 = NULL;
9131  PyObject *__pyx_t_2 = NULL;
9132  int __pyx_lineno = 0;
9133  const char *__pyx_filename = NULL;
9134  int __pyx_clineno = 0;
9135  __Pyx_RefNannySetupContext("__getitem__", 0);
9136 
9137  /* "View.MemoryView":237
9138  *
9139  * def __getitem__(self, item):
9140  * return self.memview[item] # <<<<<<<<<<<<<<
9141  *
9142  * def __setitem__(self, item, value):
9143  */
9144  __Pyx_XDECREF(__pyx_r);
9145  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
9146  __Pyx_GOTREF(__pyx_t_1);
9147  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
9148  __Pyx_GOTREF(__pyx_t_2);
9149  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9150  __pyx_r = __pyx_t_2;
9151  __pyx_t_2 = 0;
9152  goto __pyx_L0;
9153 
9154  /* "View.MemoryView":236
9155  * return getattr(self.memview, attr)
9156  *
9157  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9158  * return self.memview[item]
9159  *
9160  */
9161 
9162  /* function exit code */
9163  __pyx_L1_error:;
9164  __Pyx_XDECREF(__pyx_t_1);
9165  __Pyx_XDECREF(__pyx_t_2);
9166  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9167  __pyx_r = NULL;
9168  __pyx_L0:;
9169  __Pyx_XGIVEREF(__pyx_r);
9170  __Pyx_RefNannyFinishContext();
9171  return __pyx_r;
9172 }
9173 
9174 /* "View.MemoryView":239
9175  * return self.memview[item]
9176  *
9177  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9178  * self.memview[item] = value
9179  *
9180  */
9181 
9182 /* Python wrapper */
9183 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
9184 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9185  int __pyx_r;
9186  __Pyx_RefNannyDeclarations
9187  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
9188  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
9189 
9190  /* function exit code */
9191  __Pyx_RefNannyFinishContext();
9192  return __pyx_r;
9193 }
9194 
9195 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9196  int __pyx_r;
9197  __Pyx_RefNannyDeclarations
9198  PyObject *__pyx_t_1 = NULL;
9199  int __pyx_lineno = 0;
9200  const char *__pyx_filename = NULL;
9201  int __pyx_clineno = 0;
9202  __Pyx_RefNannySetupContext("__setitem__", 0);
9203 
9204  /* "View.MemoryView":240
9205  *
9206  * def __setitem__(self, item, value):
9207  * self.memview[item] = value # <<<<<<<<<<<<<<
9208  *
9209  *
9210  */
9211  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
9212  __Pyx_GOTREF(__pyx_t_1);
9213  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
9214  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9215 
9216  /* "View.MemoryView":239
9217  * return self.memview[item]
9218  *
9219  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9220  * self.memview[item] = value
9221  *
9222  */
9223 
9224  /* function exit code */
9225  __pyx_r = 0;
9226  goto __pyx_L0;
9227  __pyx_L1_error:;
9228  __Pyx_XDECREF(__pyx_t_1);
9229  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9230  __pyx_r = -1;
9231  __pyx_L0:;
9232  __Pyx_RefNannyFinishContext();
9233  return __pyx_r;
9234 }
9235 
9236 /* "(tree fragment)":1
9237  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9238  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9239  * def __setstate_cython__(self, __pyx_state):
9240  */
9241 
9242 /* Python wrapper */
9243 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9244 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9245  PyObject *__pyx_r = 0;
9246  __Pyx_RefNannyDeclarations
9247  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9248  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
9249 
9250  /* function exit code */
9251  __Pyx_RefNannyFinishContext();
9252  return __pyx_r;
9253 }
9254 
9255 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
9256  PyObject *__pyx_r = NULL;
9257  __Pyx_RefNannyDeclarations
9258  PyObject *__pyx_t_1 = NULL;
9259  int __pyx_lineno = 0;
9260  const char *__pyx_filename = NULL;
9261  int __pyx_clineno = 0;
9262  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9263 
9264  /* "(tree fragment)":2
9265  * def __reduce_cython__(self):
9266  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9267  * def __setstate_cython__(self, __pyx_state):
9268  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9269  */
9270  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
9271  __Pyx_GOTREF(__pyx_t_1);
9272  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9273  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9274  __PYX_ERR(1, 2, __pyx_L1_error)
9275 
9276  /* "(tree fragment)":1
9277  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9278  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9279  * def __setstate_cython__(self, __pyx_state):
9280  */
9281 
9282  /* function exit code */
9283  __pyx_L1_error:;
9284  __Pyx_XDECREF(__pyx_t_1);
9285  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9286  __pyx_r = NULL;
9287  __Pyx_XGIVEREF(__pyx_r);
9288  __Pyx_RefNannyFinishContext();
9289  return __pyx_r;
9290 }
9291 
9292 /* "(tree fragment)":3
9293  * def __reduce_cython__(self):
9294  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9295  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9296  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9297  */
9298 
9299 /* Python wrapper */
9300 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
9301 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9302  PyObject *__pyx_r = 0;
9303  __Pyx_RefNannyDeclarations
9304  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9305  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9306 
9307  /* function exit code */
9308  __Pyx_RefNannyFinishContext();
9309  return __pyx_r;
9310 }
9311 
9312 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
9313  PyObject *__pyx_r = NULL;
9314  __Pyx_RefNannyDeclarations
9315  PyObject *__pyx_t_1 = NULL;
9316  int __pyx_lineno = 0;
9317  const char *__pyx_filename = NULL;
9318  int __pyx_clineno = 0;
9319  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9320 
9321  /* "(tree fragment)":4
9322  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9323  * def __setstate_cython__(self, __pyx_state):
9324  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9325  */
9326  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
9327  __Pyx_GOTREF(__pyx_t_1);
9328  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9329  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9330  __PYX_ERR(1, 4, __pyx_L1_error)
9331 
9332  /* "(tree fragment)":3
9333  * def __reduce_cython__(self):
9334  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9335  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9336  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9337  */
9338 
9339  /* function exit code */
9340  __pyx_L1_error:;
9341  __Pyx_XDECREF(__pyx_t_1);
9342  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9343  __pyx_r = NULL;
9344  __Pyx_XGIVEREF(__pyx_r);
9345  __Pyx_RefNannyFinishContext();
9346  return __pyx_r;
9347 }
9348 
9349 /* "View.MemoryView":244
9350  *
9351  * @cname("__pyx_array_new")
9352  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
9353  * char *mode, char *buf):
9354  * cdef array result
9355  */
9356 
9357 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
9358  struct __pyx_array_obj *__pyx_v_result = 0;
9359  struct __pyx_array_obj *__pyx_r = NULL;
9360  __Pyx_RefNannyDeclarations
9361  int __pyx_t_1;
9362  PyObject *__pyx_t_2 = NULL;
9363  PyObject *__pyx_t_3 = NULL;
9364  PyObject *__pyx_t_4 = NULL;
9365  PyObject *__pyx_t_5 = NULL;
9366  int __pyx_lineno = 0;
9367  const char *__pyx_filename = NULL;
9368  int __pyx_clineno = 0;
9369  __Pyx_RefNannySetupContext("array_cwrapper", 0);
9370 
9371  /* "View.MemoryView":248
9372  * cdef array result
9373  *
9374  * if buf == NULL: # <<<<<<<<<<<<<<
9375  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9376  * else:
9377  */
9378  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
9379  if (__pyx_t_1) {
9380 
9381  /* "View.MemoryView":249
9382  *
9383  * if buf == NULL:
9384  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
9385  * else:
9386  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9387  */
9388  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
9389  __Pyx_GOTREF(__pyx_t_2);
9390  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
9391  __Pyx_GOTREF(__pyx_t_3);
9392  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
9393  __Pyx_GOTREF(__pyx_t_4);
9394  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
9395  __Pyx_GOTREF(__pyx_t_5);
9396  __Pyx_INCREF(__pyx_v_shape);
9397  __Pyx_GIVEREF(__pyx_v_shape);
9398  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
9399  __Pyx_GIVEREF(__pyx_t_2);
9400  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
9401  __Pyx_GIVEREF(__pyx_t_3);
9402  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
9403  __Pyx_GIVEREF(__pyx_t_4);
9404  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
9405  __pyx_t_2 = 0;
9406  __pyx_t_3 = 0;
9407  __pyx_t_4 = 0;
9408  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
9409  __Pyx_GOTREF(__pyx_t_4);
9410  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9411  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
9412  __pyx_t_4 = 0;
9413 
9414  /* "View.MemoryView":248
9415  * cdef array result
9416  *
9417  * if buf == NULL: # <<<<<<<<<<<<<<
9418  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9419  * else:
9420  */
9421  goto __pyx_L3;
9422  }
9423 
9424  /* "View.MemoryView":251
9425  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9426  * else:
9427  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
9428  * allocate_buffer=False)
9429  * result.data = buf
9430  */
9431  /*else*/ {
9432  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
9433  __Pyx_GOTREF(__pyx_t_4);
9434  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
9435  __Pyx_GOTREF(__pyx_t_5);
9436  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
9437  __Pyx_GOTREF(__pyx_t_3);
9438  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
9439  __Pyx_GOTREF(__pyx_t_2);
9440  __Pyx_INCREF(__pyx_v_shape);
9441  __Pyx_GIVEREF(__pyx_v_shape);
9442  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
9443  __Pyx_GIVEREF(__pyx_t_4);
9444  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
9445  __Pyx_GIVEREF(__pyx_t_5);
9446  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
9447  __Pyx_GIVEREF(__pyx_t_3);
9448  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
9449  __pyx_t_4 = 0;
9450  __pyx_t_5 = 0;
9451  __pyx_t_3 = 0;
9452 
9453  /* "View.MemoryView":252
9454  * else:
9455  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9456  * allocate_buffer=False) # <<<<<<<<<<<<<<
9457  * result.data = buf
9458  *
9459  */
9460  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
9461  __Pyx_GOTREF(__pyx_t_3);
9462  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
9463 
9464  /* "View.MemoryView":251
9465  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9466  * else:
9467  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
9468  * allocate_buffer=False)
9469  * result.data = buf
9470  */
9471  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
9472  __Pyx_GOTREF(__pyx_t_5);
9473  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9474  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9475  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
9476  __pyx_t_5 = 0;
9477 
9478  /* "View.MemoryView":253
9479  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9480  * allocate_buffer=False)
9481  * result.data = buf # <<<<<<<<<<<<<<
9482  *
9483  * return result
9484  */
9485  __pyx_v_result->data = __pyx_v_buf;
9486  }
9487  __pyx_L3:;
9488 
9489  /* "View.MemoryView":255
9490  * result.data = buf
9491  *
9492  * return result # <<<<<<<<<<<<<<
9493  *
9494  *
9495  */
9496  __Pyx_XDECREF(((PyObject *)__pyx_r));
9497  __Pyx_INCREF(((PyObject *)__pyx_v_result));
9498  __pyx_r = __pyx_v_result;
9499  goto __pyx_L0;
9500 
9501  /* "View.MemoryView":244
9502  *
9503  * @cname("__pyx_array_new")
9504  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
9505  * char *mode, char *buf):
9506  * cdef array result
9507  */
9508 
9509  /* function exit code */
9510  __pyx_L1_error:;
9511  __Pyx_XDECREF(__pyx_t_2);
9512  __Pyx_XDECREF(__pyx_t_3);
9513  __Pyx_XDECREF(__pyx_t_4);
9514  __Pyx_XDECREF(__pyx_t_5);
9515  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
9516  __pyx_r = 0;
9517  __pyx_L0:;
9518  __Pyx_XDECREF((PyObject *)__pyx_v_result);
9519  __Pyx_XGIVEREF((PyObject *)__pyx_r);
9520  __Pyx_RefNannyFinishContext();
9521  return __pyx_r;
9522 }
9523 
9524 /* "View.MemoryView":281
9525  * cdef class Enum(object):
9526  * cdef object name
9527  * def __init__(self, name): # <<<<<<<<<<<<<<
9528  * self.name = name
9529  * def __repr__(self):
9530  */
9531 
9532 /* Python wrapper */
9533 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9534 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9535  PyObject *__pyx_v_name = 0;
9536  int __pyx_lineno = 0;
9537  const char *__pyx_filename = NULL;
9538  int __pyx_clineno = 0;
9539  int __pyx_r;
9540  __Pyx_RefNannyDeclarations
9541  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
9542  {
9543  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
9544  PyObject* values[1] = {0};
9545  if (unlikely(__pyx_kwds)) {
9546  Py_ssize_t kw_args;
9547  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9548  switch (pos_args) {
9549  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9550  CYTHON_FALLTHROUGH;
9551  case 0: break;
9552  default: goto __pyx_L5_argtuple_error;
9553  }
9554  kw_args = PyDict_Size(__pyx_kwds);
9555  switch (pos_args) {
9556  case 0:
9557  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
9558  else goto __pyx_L5_argtuple_error;
9559  }
9560  if (unlikely(kw_args > 0)) {
9561  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
9562  }
9563  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9564  goto __pyx_L5_argtuple_error;
9565  } else {
9566  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9567  }
9568  __pyx_v_name = values[0];
9569  }
9570  goto __pyx_L4_argument_unpacking_done;
9571  __pyx_L5_argtuple_error:;
9572  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
9573  __pyx_L3_error:;
9574  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9575  __Pyx_RefNannyFinishContext();
9576  return -1;
9577  __pyx_L4_argument_unpacking_done:;
9578  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
9579 
9580  /* function exit code */
9581  __Pyx_RefNannyFinishContext();
9582  return __pyx_r;
9583 }
9584 
9585 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
9586  int __pyx_r;
9587  __Pyx_RefNannyDeclarations
9588  __Pyx_RefNannySetupContext("__init__", 0);
9589 
9590  /* "View.MemoryView":282
9591  * cdef object name
9592  * def __init__(self, name):
9593  * self.name = name # <<<<<<<<<<<<<<
9594  * def __repr__(self):
9595  * return self.name
9596  */
9597  __Pyx_INCREF(__pyx_v_name);
9598  __Pyx_GIVEREF(__pyx_v_name);
9599  __Pyx_GOTREF(__pyx_v_self->name);
9600  __Pyx_DECREF(__pyx_v_self->name);
9601  __pyx_v_self->name = __pyx_v_name;
9602 
9603  /* "View.MemoryView":281
9604  * cdef class Enum(object):
9605  * cdef object name
9606  * def __init__(self, name): # <<<<<<<<<<<<<<
9607  * self.name = name
9608  * def __repr__(self):
9609  */
9610 
9611  /* function exit code */
9612  __pyx_r = 0;
9613  __Pyx_RefNannyFinishContext();
9614  return __pyx_r;
9615 }
9616 
9617 /* "View.MemoryView":283
9618  * def __init__(self, name):
9619  * self.name = name
9620  * def __repr__(self): # <<<<<<<<<<<<<<
9621  * return self.name
9622  *
9623  */
9624 
9625 /* Python wrapper */
9626 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
9627 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
9628  PyObject *__pyx_r = 0;
9629  __Pyx_RefNannyDeclarations
9630  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
9631  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9632 
9633  /* function exit code */
9634  __Pyx_RefNannyFinishContext();
9635  return __pyx_r;
9636 }
9637 
9638 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9639  PyObject *__pyx_r = NULL;
9640  __Pyx_RefNannyDeclarations
9641  __Pyx_RefNannySetupContext("__repr__", 0);
9642 
9643  /* "View.MemoryView":284
9644  * self.name = name
9645  * def __repr__(self):
9646  * return self.name # <<<<<<<<<<<<<<
9647  *
9648  * cdef generic = Enum("<strided and direct or indirect>")
9649  */
9650  __Pyx_XDECREF(__pyx_r);
9651  __Pyx_INCREF(__pyx_v_self->name);
9652  __pyx_r = __pyx_v_self->name;
9653  goto __pyx_L0;
9654 
9655  /* "View.MemoryView":283
9656  * def __init__(self, name):
9657  * self.name = name
9658  * def __repr__(self): # <<<<<<<<<<<<<<
9659  * return self.name
9660  *
9661  */
9662 
9663  /* function exit code */
9664  __pyx_L0:;
9665  __Pyx_XGIVEREF(__pyx_r);
9666  __Pyx_RefNannyFinishContext();
9667  return __pyx_r;
9668 }
9669 
9670 /* "(tree fragment)":1
9671  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9672  * cdef tuple state
9673  * cdef object _dict
9674  */
9675 
9676 /* Python wrapper */
9677 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9678 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9679  PyObject *__pyx_r = 0;
9680  __Pyx_RefNannyDeclarations
9681  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9682  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9683 
9684  /* function exit code */
9685  __Pyx_RefNannyFinishContext();
9686  return __pyx_r;
9687 }
9688 
9689 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9690  PyObject *__pyx_v_state = 0;
9691  PyObject *__pyx_v__dict = 0;
9692  int __pyx_v_use_setstate;
9693  PyObject *__pyx_r = NULL;
9694  __Pyx_RefNannyDeclarations
9695  PyObject *__pyx_t_1 = NULL;
9696  int __pyx_t_2;
9697  int __pyx_t_3;
9698  PyObject *__pyx_t_4 = NULL;
9699  PyObject *__pyx_t_5 = NULL;
9700  int __pyx_lineno = 0;
9701  const char *__pyx_filename = NULL;
9702  int __pyx_clineno = 0;
9703  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9704 
9705  /* "(tree fragment)":5
9706  * cdef object _dict
9707  * cdef bint use_setstate
9708  * state = (self.name,) # <<<<<<<<<<<<<<
9709  * _dict = getattr(self, '__dict__', None)
9710  * if _dict is not None:
9711  */
9712  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
9713  __Pyx_GOTREF(__pyx_t_1);
9714  __Pyx_INCREF(__pyx_v_self->name);
9715  __Pyx_GIVEREF(__pyx_v_self->name);
9716  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
9717  __pyx_v_state = ((PyObject*)__pyx_t_1);
9718  __pyx_t_1 = 0;
9719 
9720  /* "(tree fragment)":6
9721  * cdef bint use_setstate
9722  * state = (self.name,)
9723  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
9724  * if _dict is not None:
9725  * state += (_dict,)
9726  */
9727  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
9728  __Pyx_GOTREF(__pyx_t_1);
9729  __pyx_v__dict = __pyx_t_1;
9730  __pyx_t_1 = 0;
9731 
9732  /* "(tree fragment)":7
9733  * state = (self.name,)
9734  * _dict = getattr(self, '__dict__', None)
9735  * if _dict is not None: # <<<<<<<<<<<<<<
9736  * state += (_dict,)
9737  * use_setstate = True
9738  */
9739  __pyx_t_2 = (__pyx_v__dict != Py_None);
9740  __pyx_t_3 = (__pyx_t_2 != 0);
9741  if (__pyx_t_3) {
9742 
9743  /* "(tree fragment)":8
9744  * _dict = getattr(self, '__dict__', None)
9745  * if _dict is not None:
9746  * state += (_dict,) # <<<<<<<<<<<<<<
9747  * use_setstate = True
9748  * else:
9749  */
9750  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
9751  __Pyx_GOTREF(__pyx_t_1);
9752  __Pyx_INCREF(__pyx_v__dict);
9753  __Pyx_GIVEREF(__pyx_v__dict);
9754  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
9755  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
9756  __Pyx_GOTREF(__pyx_t_4);
9757  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9758  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
9759  __pyx_t_4 = 0;
9760 
9761  /* "(tree fragment)":9
9762  * if _dict is not None:
9763  * state += (_dict,)
9764  * use_setstate = True # <<<<<<<<<<<<<<
9765  * else:
9766  * use_setstate = self.name is not None
9767  */
9768  __pyx_v_use_setstate = 1;
9769 
9770  /* "(tree fragment)":7
9771  * state = (self.name,)
9772  * _dict = getattr(self, '__dict__', None)
9773  * if _dict is not None: # <<<<<<<<<<<<<<
9774  * state += (_dict,)
9775  * use_setstate = True
9776  */
9777  goto __pyx_L3;
9778  }
9779 
9780  /* "(tree fragment)":11
9781  * use_setstate = True
9782  * else:
9783  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
9784  * if use_setstate:
9785  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9786  */
9787  /*else*/ {
9788  __pyx_t_3 = (__pyx_v_self->name != Py_None);
9789  __pyx_v_use_setstate = __pyx_t_3;
9790  }
9791  __pyx_L3:;
9792 
9793  /* "(tree fragment)":12
9794  * else:
9795  * use_setstate = self.name is not None
9796  * if use_setstate: # <<<<<<<<<<<<<<
9797  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9798  * else:
9799  */
9800  __pyx_t_3 = (__pyx_v_use_setstate != 0);
9801  if (__pyx_t_3) {
9802 
9803  /* "(tree fragment)":13
9804  * use_setstate = self.name is not None
9805  * if use_setstate:
9806  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
9807  * else:
9808  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9809  */
9810  __Pyx_XDECREF(__pyx_r);
9811  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
9812  __Pyx_GOTREF(__pyx_t_4);
9813  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
9814  __Pyx_GOTREF(__pyx_t_1);
9815  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9816  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9817  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9818  __Pyx_INCREF(__pyx_int_184977713);
9819  __Pyx_GIVEREF(__pyx_int_184977713);
9820  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9821  __Pyx_INCREF(Py_None);
9822  __Pyx_GIVEREF(Py_None);
9823  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
9824  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
9825  __Pyx_GOTREF(__pyx_t_5);
9826  __Pyx_GIVEREF(__pyx_t_4);
9827  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
9828  __Pyx_GIVEREF(__pyx_t_1);
9829  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
9830  __Pyx_INCREF(__pyx_v_state);
9831  __Pyx_GIVEREF(__pyx_v_state);
9832  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
9833  __pyx_t_4 = 0;
9834  __pyx_t_1 = 0;
9835  __pyx_r = __pyx_t_5;
9836  __pyx_t_5 = 0;
9837  goto __pyx_L0;
9838 
9839  /* "(tree fragment)":12
9840  * else:
9841  * use_setstate = self.name is not None
9842  * if use_setstate: # <<<<<<<<<<<<<<
9843  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9844  * else:
9845  */
9846  }
9847 
9848  /* "(tree fragment)":15
9849  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9850  * else:
9851  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
9852  * def __setstate_cython__(self, __pyx_state):
9853  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
9854  */
9855  /*else*/ {
9856  __Pyx_XDECREF(__pyx_r);
9857  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
9858  __Pyx_GOTREF(__pyx_t_5);
9859  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
9860  __Pyx_GOTREF(__pyx_t_1);
9861  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9862  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9863  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9864  __Pyx_INCREF(__pyx_int_184977713);
9865  __Pyx_GIVEREF(__pyx_int_184977713);
9866  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9867  __Pyx_INCREF(__pyx_v_state);
9868  __Pyx_GIVEREF(__pyx_v_state);
9869  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
9870  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
9871  __Pyx_GOTREF(__pyx_t_4);
9872  __Pyx_GIVEREF(__pyx_t_5);
9873  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
9874  __Pyx_GIVEREF(__pyx_t_1);
9875  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
9876  __pyx_t_5 = 0;
9877  __pyx_t_1 = 0;
9878  __pyx_r = __pyx_t_4;
9879  __pyx_t_4 = 0;
9880  goto __pyx_L0;
9881  }
9882 
9883  /* "(tree fragment)":1
9884  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9885  * cdef tuple state
9886  * cdef object _dict
9887  */
9888 
9889  /* function exit code */
9890  __pyx_L1_error:;
9891  __Pyx_XDECREF(__pyx_t_1);
9892  __Pyx_XDECREF(__pyx_t_4);
9893  __Pyx_XDECREF(__pyx_t_5);
9894  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9895  __pyx_r = NULL;
9896  __pyx_L0:;
9897  __Pyx_XDECREF(__pyx_v_state);
9898  __Pyx_XDECREF(__pyx_v__dict);
9899  __Pyx_XGIVEREF(__pyx_r);
9900  __Pyx_RefNannyFinishContext();
9901  return __pyx_r;
9902 }
9903 
9904 /* "(tree fragment)":16
9905  * else:
9906  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9907  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9908  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
9909  */
9910 
9911 /* Python wrapper */
9912 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
9913 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9914  PyObject *__pyx_r = 0;
9915  __Pyx_RefNannyDeclarations
9916  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9917  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9918 
9919  /* function exit code */
9920  __Pyx_RefNannyFinishContext();
9921  return __pyx_r;
9922 }
9923 
9924 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9925  PyObject *__pyx_r = NULL;
9926  __Pyx_RefNannyDeclarations
9927  PyObject *__pyx_t_1 = NULL;
9928  int __pyx_lineno = 0;
9929  const char *__pyx_filename = NULL;
9930  int __pyx_clineno = 0;
9931  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9932 
9933  /* "(tree fragment)":17
9934  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9935  * def __setstate_cython__(self, __pyx_state):
9936  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
9937  */
9938  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
9939  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
9940  __Pyx_GOTREF(__pyx_t_1);
9941  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9942 
9943  /* "(tree fragment)":16
9944  * else:
9945  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9946  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9947  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
9948  */
9949 
9950  /* function exit code */
9951  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9952  goto __pyx_L0;
9953  __pyx_L1_error:;
9954  __Pyx_XDECREF(__pyx_t_1);
9955  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9956  __pyx_r = NULL;
9957  __pyx_L0:;
9958  __Pyx_XGIVEREF(__pyx_r);
9959  __Pyx_RefNannyFinishContext();
9960  return __pyx_r;
9961 }
9962 
9963 /* "View.MemoryView":298
9964  *
9965  * @cname('__pyx_align_pointer')
9966  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
9967  * "Align pointer memory on a given boundary"
9968  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
9969  */
9970 
9971 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
9972  Py_intptr_t __pyx_v_aligned_p;
9973  size_t __pyx_v_offset;
9974  void *__pyx_r;
9975  int __pyx_t_1;
9976 
9977  /* "View.MemoryView":300
9978  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
9979  * "Align pointer memory on a given boundary"
9980  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
9981  * cdef size_t offset
9982  *
9983  */
9984  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
9985 
9986  /* "View.MemoryView":304
9987  *
9988  * with cython.cdivision(True):
9989  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
9990  *
9991  * if offset > 0:
9992  */
9993  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
9994 
9995  /* "View.MemoryView":306
9996  * offset = aligned_p % alignment
9997  *
9998  * if offset > 0: # <<<<<<<<<<<<<<
9999  * aligned_p += alignment - offset
10000  *
10001  */
10002  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10003  if (__pyx_t_1) {
10004 
10005  /* "View.MemoryView":307
10006  *
10007  * if offset > 0:
10008  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
10009  *
10010  * return <void *> aligned_p
10011  */
10012  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10013 
10014  /* "View.MemoryView":306
10015  * offset = aligned_p % alignment
10016  *
10017  * if offset > 0: # <<<<<<<<<<<<<<
10018  * aligned_p += alignment - offset
10019  *
10020  */
10021  }
10022 
10023  /* "View.MemoryView":309
10024  * aligned_p += alignment - offset
10025  *
10026  * return <void *> aligned_p # <<<<<<<<<<<<<<
10027  *
10028  *
10029  */
10030  __pyx_r = ((void *)__pyx_v_aligned_p);
10031  goto __pyx_L0;
10032 
10033  /* "View.MemoryView":298
10034  *
10035  * @cname('__pyx_align_pointer')
10036  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10037  * "Align pointer memory on a given boundary"
10038  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10039  */
10040 
10041  /* function exit code */
10042  __pyx_L0:;
10043  return __pyx_r;
10044 }
10045 
10046 /* "View.MemoryView":345
10047  * cdef __Pyx_TypeInfo *typeinfo
10048  *
10049  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10050  * self.obj = obj
10051  * self.flags = flags
10052  */
10053 
10054 /* Python wrapper */
10055 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10056 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10057  PyObject *__pyx_v_obj = 0;
10058  int __pyx_v_flags;
10059  int __pyx_v_dtype_is_object;
10060  int __pyx_lineno = 0;
10061  const char *__pyx_filename = NULL;
10062  int __pyx_clineno = 0;
10063  int __pyx_r;
10064  __Pyx_RefNannyDeclarations
10065  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
10066  {
10067  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
10068  PyObject* values[3] = {0,0,0};
10069  if (unlikely(__pyx_kwds)) {
10070  Py_ssize_t kw_args;
10071  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10072  switch (pos_args) {
10073  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10074  CYTHON_FALLTHROUGH;
10075  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10076  CYTHON_FALLTHROUGH;
10077  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10078  CYTHON_FALLTHROUGH;
10079  case 0: break;
10080  default: goto __pyx_L5_argtuple_error;
10081  }
10082  kw_args = PyDict_Size(__pyx_kwds);
10083  switch (pos_args) {
10084  case 0:
10085  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
10086  else goto __pyx_L5_argtuple_error;
10087  CYTHON_FALLTHROUGH;
10088  case 1:
10089  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
10090  else {
10091  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
10092  }
10093  CYTHON_FALLTHROUGH;
10094  case 2:
10095  if (kw_args > 0) {
10096  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
10097  if (value) { values[2] = value; kw_args--; }
10098  }
10099  }
10100  if (unlikely(kw_args > 0)) {
10101  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
10102  }
10103  } else {
10104  switch (PyTuple_GET_SIZE(__pyx_args)) {
10105  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10106  CYTHON_FALLTHROUGH;
10107  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10108  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10109  break;
10110  default: goto __pyx_L5_argtuple_error;
10111  }
10112  }
10113  __pyx_v_obj = values[0];
10114  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
10115  if (values[2]) {
10116  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
10117  } else {
10118  __pyx_v_dtype_is_object = ((int)0);
10119  }
10120  }
10121  goto __pyx_L4_argument_unpacking_done;
10122  __pyx_L5_argtuple_error:;
10123  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
10124  __pyx_L3_error:;
10125  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10126  __Pyx_RefNannyFinishContext();
10127  return -1;
10128  __pyx_L4_argument_unpacking_done:;
10129  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
10130 
10131  /* function exit code */
10132  __Pyx_RefNannyFinishContext();
10133  return __pyx_r;
10134 }
10135 
10136 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
10137  int __pyx_r;
10138  __Pyx_RefNannyDeclarations
10139  int __pyx_t_1;
10140  int __pyx_t_2;
10141  int __pyx_t_3;
10142  int __pyx_t_4;
10143  int __pyx_lineno = 0;
10144  const char *__pyx_filename = NULL;
10145  int __pyx_clineno = 0;
10146  __Pyx_RefNannySetupContext("__cinit__", 0);
10147 
10148  /* "View.MemoryView":346
10149  *
10150  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10151  * self.obj = obj # <<<<<<<<<<<<<<
10152  * self.flags = flags
10153  * if type(self) is memoryview or obj is not None:
10154  */
10155  __Pyx_INCREF(__pyx_v_obj);
10156  __Pyx_GIVEREF(__pyx_v_obj);
10157  __Pyx_GOTREF(__pyx_v_self->obj);
10158  __Pyx_DECREF(__pyx_v_self->obj);
10159  __pyx_v_self->obj = __pyx_v_obj;
10160 
10161  /* "View.MemoryView":347
10162  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10163  * self.obj = obj
10164  * self.flags = flags # <<<<<<<<<<<<<<
10165  * if type(self) is memoryview or obj is not None:
10166  * __Pyx_GetBuffer(obj, &self.view, flags)
10167  */
10168  __pyx_v_self->flags = __pyx_v_flags;
10169 
10170  /* "View.MemoryView":348
10171  * self.obj = obj
10172  * self.flags = flags
10173  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10174  * __Pyx_GetBuffer(obj, &self.view, flags)
10175  * if <PyObject *> self.view.obj == NULL:
10176  */
10177  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
10178  __pyx_t_3 = (__pyx_t_2 != 0);
10179  if (!__pyx_t_3) {
10180  } else {
10181  __pyx_t_1 = __pyx_t_3;
10182  goto __pyx_L4_bool_binop_done;
10183  }
10184  __pyx_t_3 = (__pyx_v_obj != Py_None);
10185  __pyx_t_2 = (__pyx_t_3 != 0);
10186  __pyx_t_1 = __pyx_t_2;
10187  __pyx_L4_bool_binop_done:;
10188  if (__pyx_t_1) {
10189 
10190  /* "View.MemoryView":349
10191  * self.flags = flags
10192  * if type(self) is memoryview or obj is not None:
10193  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
10194  * if <PyObject *> self.view.obj == NULL:
10195  * (<__pyx_buffer *> &self.view).obj = Py_None
10196  */
10197  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
10198 
10199  /* "View.MemoryView":350
10200  * if type(self) is memoryview or obj is not None:
10201  * __Pyx_GetBuffer(obj, &self.view, flags)
10202  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10203  * (<__pyx_buffer *> &self.view).obj = Py_None
10204  * Py_INCREF(Py_None)
10205  */
10206  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
10207  if (__pyx_t_1) {
10208 
10209  /* "View.MemoryView":351
10210  * __Pyx_GetBuffer(obj, &self.view, flags)
10211  * if <PyObject *> self.view.obj == NULL:
10212  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
10213  * Py_INCREF(Py_None)
10214  *
10215  */
10216  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
10217 
10218  /* "View.MemoryView":352
10219  * if <PyObject *> self.view.obj == NULL:
10220  * (<__pyx_buffer *> &self.view).obj = Py_None
10221  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
10222  *
10223  * global __pyx_memoryview_thread_locks_used
10224  */
10225  Py_INCREF(Py_None);
10226 
10227  /* "View.MemoryView":350
10228  * if type(self) is memoryview or obj is not None:
10229  * __Pyx_GetBuffer(obj, &self.view, flags)
10230  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10231  * (<__pyx_buffer *> &self.view).obj = Py_None
10232  * Py_INCREF(Py_None)
10233  */
10234  }
10235 
10236  /* "View.MemoryView":348
10237  * self.obj = obj
10238  * self.flags = flags
10239  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10240  * __Pyx_GetBuffer(obj, &self.view, flags)
10241  * if <PyObject *> self.view.obj == NULL:
10242  */
10243  }
10244 
10245  /* "View.MemoryView":355
10246  *
10247  * global __pyx_memoryview_thread_locks_used
10248  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10249  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10250  * __pyx_memoryview_thread_locks_used += 1
10251  */
10252  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
10253  if (__pyx_t_1) {
10254 
10255  /* "View.MemoryView":356
10256  * global __pyx_memoryview_thread_locks_used
10257  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10258  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
10259  * __pyx_memoryview_thread_locks_used += 1
10260  * if self.lock is NULL:
10261  */
10262  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10263 
10264  /* "View.MemoryView":357
10265  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10266  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10267  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
10268  * if self.lock is NULL:
10269  * self.lock = PyThread_allocate_lock()
10270  */
10271  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
10272 
10273  /* "View.MemoryView":355
10274  *
10275  * global __pyx_memoryview_thread_locks_used
10276  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10277  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10278  * __pyx_memoryview_thread_locks_used += 1
10279  */
10280  }
10281 
10282  /* "View.MemoryView":358
10283  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10284  * __pyx_memoryview_thread_locks_used += 1
10285  * if self.lock is NULL: # <<<<<<<<<<<<<<
10286  * self.lock = PyThread_allocate_lock()
10287  * if self.lock is NULL:
10288  */
10289  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10290  if (__pyx_t_1) {
10291 
10292  /* "View.MemoryView":359
10293  * __pyx_memoryview_thread_locks_used += 1
10294  * if self.lock is NULL:
10295  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
10296  * if self.lock is NULL:
10297  * raise MemoryError
10298  */
10299  __pyx_v_self->lock = PyThread_allocate_lock();
10300 
10301  /* "View.MemoryView":360
10302  * if self.lock is NULL:
10303  * self.lock = PyThread_allocate_lock()
10304  * if self.lock is NULL: # <<<<<<<<<<<<<<
10305  * raise MemoryError
10306  *
10307  */
10308  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10309  if (unlikely(__pyx_t_1)) {
10310 
10311  /* "View.MemoryView":361
10312  * self.lock = PyThread_allocate_lock()
10313  * if self.lock is NULL:
10314  * raise MemoryError # <<<<<<<<<<<<<<
10315  *
10316  * if flags & PyBUF_FORMAT:
10317  */
10318  PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
10319 
10320  /* "View.MemoryView":360
10321  * if self.lock is NULL:
10322  * self.lock = PyThread_allocate_lock()
10323  * if self.lock is NULL: # <<<<<<<<<<<<<<
10324  * raise MemoryError
10325  *
10326  */
10327  }
10328 
10329  /* "View.MemoryView":358
10330  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10331  * __pyx_memoryview_thread_locks_used += 1
10332  * if self.lock is NULL: # <<<<<<<<<<<<<<
10333  * self.lock = PyThread_allocate_lock()
10334  * if self.lock is NULL:
10335  */
10336  }
10337 
10338  /* "View.MemoryView":363
10339  * raise MemoryError
10340  *
10341  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10342  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10343  * else:
10344  */
10345  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10346  if (__pyx_t_1) {
10347 
10348  /* "View.MemoryView":364
10349  *
10350  * if flags & PyBUF_FORMAT:
10351  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
10352  * else:
10353  * self.dtype_is_object = dtype_is_object
10354  */
10355  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
10356  if (__pyx_t_2) {
10357  } else {
10358  __pyx_t_1 = __pyx_t_2;
10359  goto __pyx_L11_bool_binop_done;
10360  }
10361  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
10362  __pyx_t_1 = __pyx_t_2;
10363  __pyx_L11_bool_binop_done:;
10364  __pyx_v_self->dtype_is_object = __pyx_t_1;
10365 
10366  /* "View.MemoryView":363
10367  * raise MemoryError
10368  *
10369  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10370  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10371  * else:
10372  */
10373  goto __pyx_L10;
10374  }
10375 
10376  /* "View.MemoryView":366
10377  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10378  * else:
10379  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
10380  *
10381  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
10382  */
10383  /*else*/ {
10384  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
10385  }
10386  __pyx_L10:;
10387 
10388  /* "View.MemoryView":368
10389  * self.dtype_is_object = dtype_is_object
10390  *
10391  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
10392  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
10393  * self.typeinfo = NULL
10394  */
10395  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
10396 
10397  /* "View.MemoryView":370
10398  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
10399  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
10400  * self.typeinfo = NULL # <<<<<<<<<<<<<<
10401  *
10402  * def __dealloc__(memoryview self):
10403  */
10404  __pyx_v_self->typeinfo = NULL;
10405 
10406  /* "View.MemoryView":345
10407  * cdef __Pyx_TypeInfo *typeinfo
10408  *
10409  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10410  * self.obj = obj
10411  * self.flags = flags
10412  */
10413 
10414  /* function exit code */
10415  __pyx_r = 0;
10416  goto __pyx_L0;
10417  __pyx_L1_error:;
10418  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10419  __pyx_r = -1;
10420  __pyx_L0:;
10421  __Pyx_RefNannyFinishContext();
10422  return __pyx_r;
10423 }
10424 
10425 /* "View.MemoryView":372
10426  * self.typeinfo = NULL
10427  *
10428  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
10429  * if self.obj is not None:
10430  * __Pyx_ReleaseBuffer(&self.view)
10431  */
10432 
10433 /* Python wrapper */
10434 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
10435 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
10436  __Pyx_RefNannyDeclarations
10437  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
10438  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10439 
10440  /* function exit code */
10441  __Pyx_RefNannyFinishContext();
10442 }
10443 
10444 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
10445  int __pyx_v_i;
10446  __Pyx_RefNannyDeclarations
10447  int __pyx_t_1;
10448  int __pyx_t_2;
10449  int __pyx_t_3;
10450  int __pyx_t_4;
10451  int __pyx_t_5;
10452  PyThread_type_lock __pyx_t_6;
10453  PyThread_type_lock __pyx_t_7;
10454  __Pyx_RefNannySetupContext("__dealloc__", 0);
10455 
10456  /* "View.MemoryView":373
10457  *
10458  * def __dealloc__(memoryview self):
10459  * if self.obj is not None: # <<<<<<<<<<<<<<
10460  * __Pyx_ReleaseBuffer(&self.view)
10461  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10462  */
10463  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
10464  __pyx_t_2 = (__pyx_t_1 != 0);
10465  if (__pyx_t_2) {
10466 
10467  /* "View.MemoryView":374
10468  * def __dealloc__(memoryview self):
10469  * if self.obj is not None:
10470  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
10471  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10472  *
10473  */
10474  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
10475 
10476  /* "View.MemoryView":373
10477  *
10478  * def __dealloc__(memoryview self):
10479  * if self.obj is not None: # <<<<<<<<<<<<<<
10480  * __Pyx_ReleaseBuffer(&self.view)
10481  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10482  */
10483  goto __pyx_L3;
10484  }
10485 
10486  /* "View.MemoryView":375
10487  * if self.obj is not None:
10488  * __Pyx_ReleaseBuffer(&self.view)
10489  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
10490  *
10491  * (<__pyx_buffer *> &self.view).obj = NULL
10492  */
10493  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
10494  if (__pyx_t_2) {
10495 
10496  /* "View.MemoryView":377
10497  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10498  *
10499  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
10500  * Py_DECREF(Py_None)
10501  *
10502  */
10503  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
10504 
10505  /* "View.MemoryView":378
10506  *
10507  * (<__pyx_buffer *> &self.view).obj = NULL
10508  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
10509  *
10510  * cdef int i
10511  */
10512  Py_DECREF(Py_None);
10513 
10514  /* "View.MemoryView":375
10515  * if self.obj is not None:
10516  * __Pyx_ReleaseBuffer(&self.view)
10517  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
10518  *
10519  * (<__pyx_buffer *> &self.view).obj = NULL
10520  */
10521  }
10522  __pyx_L3:;
10523 
10524  /* "View.MemoryView":382
10525  * cdef int i
10526  * global __pyx_memoryview_thread_locks_used
10527  * if self.lock != NULL: # <<<<<<<<<<<<<<
10528  * for i in range(__pyx_memoryview_thread_locks_used):
10529  * if __pyx_memoryview_thread_locks[i] is self.lock:
10530  */
10531  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
10532  if (__pyx_t_2) {
10533 
10534  /* "View.MemoryView":383
10535  * global __pyx_memoryview_thread_locks_used
10536  * if self.lock != NULL:
10537  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
10538  * if __pyx_memoryview_thread_locks[i] is self.lock:
10539  * __pyx_memoryview_thread_locks_used -= 1
10540  */
10541  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
10542  __pyx_t_4 = __pyx_t_3;
10543  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
10544  __pyx_v_i = __pyx_t_5;
10545 
10546  /* "View.MemoryView":384
10547  * if self.lock != NULL:
10548  * for i in range(__pyx_memoryview_thread_locks_used):
10549  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
10550  * __pyx_memoryview_thread_locks_used -= 1
10551  * if i != __pyx_memoryview_thread_locks_used:
10552  */
10553  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
10554  if (__pyx_t_2) {
10555 
10556  /* "View.MemoryView":385
10557  * for i in range(__pyx_memoryview_thread_locks_used):
10558  * if __pyx_memoryview_thread_locks[i] is self.lock:
10559  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
10560  * if i != __pyx_memoryview_thread_locks_used:
10561  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10562  */
10563  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
10564 
10565  /* "View.MemoryView":386
10566  * if __pyx_memoryview_thread_locks[i] is self.lock:
10567  * __pyx_memoryview_thread_locks_used -= 1
10568  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
10569  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10570  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10571  */
10572  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
10573  if (__pyx_t_2) {
10574 
10575  /* "View.MemoryView":388
10576  * if i != __pyx_memoryview_thread_locks_used:
10577  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10578  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
10579  * break
10580  * else:
10581  */
10582  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10583  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
10584 
10585  /* "View.MemoryView":387
10586  * __pyx_memoryview_thread_locks_used -= 1
10587  * if i != __pyx_memoryview_thread_locks_used:
10588  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
10589  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10590  * break
10591  */
10592  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
10593  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
10594 
10595  /* "View.MemoryView":386
10596  * if __pyx_memoryview_thread_locks[i] is self.lock:
10597  * __pyx_memoryview_thread_locks_used -= 1
10598  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
10599  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10600  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10601  */
10602  }
10603 
10604  /* "View.MemoryView":389
10605  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10606  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10607  * break # <<<<<<<<<<<<<<
10608  * else:
10609  * PyThread_free_lock(self.lock)
10610  */
10611  goto __pyx_L6_break;
10612 
10613  /* "View.MemoryView":384
10614  * if self.lock != NULL:
10615  * for i in range(__pyx_memoryview_thread_locks_used):
10616  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
10617  * __pyx_memoryview_thread_locks_used -= 1
10618  * if i != __pyx_memoryview_thread_locks_used:
10619  */
10620  }
10621  }
10622  /*else*/ {
10623 
10624  /* "View.MemoryView":391
10625  * break
10626  * else:
10627  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
10628  *
10629  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
10630  */
10631  PyThread_free_lock(__pyx_v_self->lock);
10632  }
10633  __pyx_L6_break:;
10634 
10635  /* "View.MemoryView":382
10636  * cdef int i
10637  * global __pyx_memoryview_thread_locks_used
10638  * if self.lock != NULL: # <<<<<<<<<<<<<<
10639  * for i in range(__pyx_memoryview_thread_locks_used):
10640  * if __pyx_memoryview_thread_locks[i] is self.lock:
10641  */
10642  }
10643 
10644  /* "View.MemoryView":372
10645  * self.typeinfo = NULL
10646  *
10647  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
10648  * if self.obj is not None:
10649  * __Pyx_ReleaseBuffer(&self.view)
10650  */
10651 
10652  /* function exit code */
10653  __Pyx_RefNannyFinishContext();
10654 }
10655 
10656 /* "View.MemoryView":393
10657  * PyThread_free_lock(self.lock)
10658  *
10659  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
10660  * cdef Py_ssize_t dim
10661  * cdef char *itemp = <char *> self.view.buf
10662  */
10663 
10664 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10665  Py_ssize_t __pyx_v_dim;
10666  char *__pyx_v_itemp;
10667  PyObject *__pyx_v_idx = NULL;
10668  char *__pyx_r;
10669  __Pyx_RefNannyDeclarations
10670  Py_ssize_t __pyx_t_1;
10671  PyObject *__pyx_t_2 = NULL;
10672  Py_ssize_t __pyx_t_3;
10673  PyObject *(*__pyx_t_4)(PyObject *);
10674  PyObject *__pyx_t_5 = NULL;
10675  Py_ssize_t __pyx_t_6;
10676  char *__pyx_t_7;
10677  int __pyx_lineno = 0;
10678  const char *__pyx_filename = NULL;
10679  int __pyx_clineno = 0;
10680  __Pyx_RefNannySetupContext("get_item_pointer", 0);
10681 
10682  /* "View.MemoryView":395
10683  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
10684  * cdef Py_ssize_t dim
10685  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
10686  *
10687  * for dim, idx in enumerate(index):
10688  */
10689  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
10690 
10691  /* "View.MemoryView":397
10692  * cdef char *itemp = <char *> self.view.buf
10693  *
10694  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
10695  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10696  *
10697  */
10698  __pyx_t_1 = 0;
10699  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
10700  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
10701  __pyx_t_4 = NULL;
10702  } else {
10703  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
10704  __Pyx_GOTREF(__pyx_t_2);
10705  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
10706  }
10707  for (;;) {
10708  if (likely(!__pyx_t_4)) {
10709  if (likely(PyList_CheckExact(__pyx_t_2))) {
10710  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
10711  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10712  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
10713  #else
10714  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
10715  __Pyx_GOTREF(__pyx_t_5);
10716  #endif
10717  } else {
10718  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
10719  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10720  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
10721  #else
10722  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
10723  __Pyx_GOTREF(__pyx_t_5);
10724  #endif
10725  }
10726  } else {
10727  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
10728  if (unlikely(!__pyx_t_5)) {
10729  PyObject* exc_type = PyErr_Occurred();
10730  if (exc_type) {
10731  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
10732  else __PYX_ERR(1, 397, __pyx_L1_error)
10733  }
10734  break;
10735  }
10736  __Pyx_GOTREF(__pyx_t_5);
10737  }
10738  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
10739  __pyx_t_5 = 0;
10740  __pyx_v_dim = __pyx_t_1;
10741  __pyx_t_1 = (__pyx_t_1 + 1);
10742 
10743  /* "View.MemoryView":398
10744  *
10745  * for dim, idx in enumerate(index):
10746  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
10747  *
10748  * return itemp
10749  */
10750  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
10751  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
10752  __pyx_v_itemp = __pyx_t_7;
10753 
10754  /* "View.MemoryView":397
10755  * cdef char *itemp = <char *> self.view.buf
10756  *
10757  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
10758  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10759  *
10760  */
10761  }
10762  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10763 
10764  /* "View.MemoryView":400
10765  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10766  *
10767  * return itemp # <<<<<<<<<<<<<<
10768  *
10769  *
10770  */
10771  __pyx_r = __pyx_v_itemp;
10772  goto __pyx_L0;
10773 
10774  /* "View.MemoryView":393
10775  * PyThread_free_lock(self.lock)
10776  *
10777  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
10778  * cdef Py_ssize_t dim
10779  * cdef char *itemp = <char *> self.view.buf
10780  */
10781 
10782  /* function exit code */
10783  __pyx_L1_error:;
10784  __Pyx_XDECREF(__pyx_t_2);
10785  __Pyx_XDECREF(__pyx_t_5);
10786  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
10787  __pyx_r = NULL;
10788  __pyx_L0:;
10789  __Pyx_XDECREF(__pyx_v_idx);
10790  __Pyx_RefNannyFinishContext();
10791  return __pyx_r;
10792 }
10793 
10794 /* "View.MemoryView":403
10795  *
10796  *
10797  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
10798  * if index is Ellipsis:
10799  * return self
10800  */
10801 
10802 /* Python wrapper */
10803 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
10804 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
10805  PyObject *__pyx_r = 0;
10806  __Pyx_RefNannyDeclarations
10807  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
10808  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
10809 
10810  /* function exit code */
10811  __Pyx_RefNannyFinishContext();
10812  return __pyx_r;
10813 }
10814 
10815 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10816  PyObject *__pyx_v_have_slices = NULL;
10817  PyObject *__pyx_v_indices = NULL;
10818  char *__pyx_v_itemp;
10819  PyObject *__pyx_r = NULL;
10820  __Pyx_RefNannyDeclarations
10821  int __pyx_t_1;
10822  int __pyx_t_2;
10823  PyObject *__pyx_t_3 = NULL;
10824  PyObject *__pyx_t_4 = NULL;
10825  PyObject *__pyx_t_5 = NULL;
10826  char *__pyx_t_6;
10827  int __pyx_lineno = 0;
10828  const char *__pyx_filename = NULL;
10829  int __pyx_clineno = 0;
10830  __Pyx_RefNannySetupContext("__getitem__", 0);
10831 
10832  /* "View.MemoryView":404
10833  *
10834  * def __getitem__(memoryview self, object index):
10835  * if index is Ellipsis: # <<<<<<<<<<<<<<
10836  * return self
10837  *
10838  */
10839  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
10840  __pyx_t_2 = (__pyx_t_1 != 0);
10841  if (__pyx_t_2) {
10842 
10843  /* "View.MemoryView":405
10844  * def __getitem__(memoryview self, object index):
10845  * if index is Ellipsis:
10846  * return self # <<<<<<<<<<<<<<
10847  *
10848  * have_slices, indices = _unellipsify(index, self.view.ndim)
10849  */
10850  __Pyx_XDECREF(__pyx_r);
10851  __Pyx_INCREF(((PyObject *)__pyx_v_self));
10852  __pyx_r = ((PyObject *)__pyx_v_self);
10853  goto __pyx_L0;
10854 
10855  /* "View.MemoryView":404
10856  *
10857  * def __getitem__(memoryview self, object index):
10858  * if index is Ellipsis: # <<<<<<<<<<<<<<
10859  * return self
10860  *
10861  */
10862  }
10863 
10864  /* "View.MemoryView":407
10865  * return self
10866  *
10867  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
10868  *
10869  * cdef char *itemp
10870  */
10871  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
10872  __Pyx_GOTREF(__pyx_t_3);
10873  if (likely(__pyx_t_3 != Py_None)) {
10874  PyObject* sequence = __pyx_t_3;
10875  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10876  if (unlikely(size != 2)) {
10877  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10878  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10879  __PYX_ERR(1, 407, __pyx_L1_error)
10880  }
10881  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10882  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
10883  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
10884  __Pyx_INCREF(__pyx_t_4);
10885  __Pyx_INCREF(__pyx_t_5);
10886  #else
10887  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
10888  __Pyx_GOTREF(__pyx_t_4);
10889  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
10890  __Pyx_GOTREF(__pyx_t_5);
10891  #endif
10892  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10893  } else {
10894  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
10895  }
10896  __pyx_v_have_slices = __pyx_t_4;
10897  __pyx_t_4 = 0;
10898  __pyx_v_indices = __pyx_t_5;
10899  __pyx_t_5 = 0;
10900 
10901  /* "View.MemoryView":410
10902  *
10903  * cdef char *itemp
10904  * if have_slices: # <<<<<<<<<<<<<<
10905  * return memview_slice(self, indices)
10906  * else:
10907  */
10908  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
10909  if (__pyx_t_2) {
10910 
10911  /* "View.MemoryView":411
10912  * cdef char *itemp
10913  * if have_slices:
10914  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
10915  * else:
10916  * itemp = self.get_item_pointer(indices)
10917  */
10918  __Pyx_XDECREF(__pyx_r);
10919  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
10920  __Pyx_GOTREF(__pyx_t_3);
10921  __pyx_r = __pyx_t_3;
10922  __pyx_t_3 = 0;
10923  goto __pyx_L0;
10924 
10925  /* "View.MemoryView":410
10926  *
10927  * cdef char *itemp
10928  * if have_slices: # <<<<<<<<<<<<<<
10929  * return memview_slice(self, indices)
10930  * else:
10931  */
10932  }
10933 
10934  /* "View.MemoryView":413
10935  * return memview_slice(self, indices)
10936  * else:
10937  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
10938  * return self.convert_item_to_object(itemp)
10939  *
10940  */
10941  /*else*/ {
10942  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
10943  __pyx_v_itemp = __pyx_t_6;
10944 
10945  /* "View.MemoryView":414
10946  * else:
10947  * itemp = self.get_item_pointer(indices)
10948  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
10949  *
10950  * def __setitem__(memoryview self, object index, object value):
10951  */
10952  __Pyx_XDECREF(__pyx_r);
10953  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
10954  __Pyx_GOTREF(__pyx_t_3);
10955  __pyx_r = __pyx_t_3;
10956  __pyx_t_3 = 0;
10957  goto __pyx_L0;
10958  }
10959 
10960  /* "View.MemoryView":403
10961  *
10962  *
10963  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
10964  * if index is Ellipsis:
10965  * return self
10966  */
10967 
10968  /* function exit code */
10969  __pyx_L1_error:;
10970  __Pyx_XDECREF(__pyx_t_3);
10971  __Pyx_XDECREF(__pyx_t_4);
10972  __Pyx_XDECREF(__pyx_t_5);
10973  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10974  __pyx_r = NULL;
10975  __pyx_L0:;
10976  __Pyx_XDECREF(__pyx_v_have_slices);
10977  __Pyx_XDECREF(__pyx_v_indices);
10978  __Pyx_XGIVEREF(__pyx_r);
10979  __Pyx_RefNannyFinishContext();
10980  return __pyx_r;
10981 }
10982 
10983 /* "View.MemoryView":416
10984  * return self.convert_item_to_object(itemp)
10985  *
10986  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
10987  * if self.view.readonly:
10988  * raise TypeError("Cannot assign to read-only memoryview")
10989  */
10990 
10991 /* Python wrapper */
10992 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
10993 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10994  int __pyx_r;
10995  __Pyx_RefNannyDeclarations
10996  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
10997  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
10998 
10999  /* function exit code */
11000  __Pyx_RefNannyFinishContext();
11001  return __pyx_r;
11002 }
11003 
11004 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11005  PyObject *__pyx_v_have_slices = NULL;
11006  PyObject *__pyx_v_obj = NULL;
11007  int __pyx_r;
11008  __Pyx_RefNannyDeclarations
11009  int __pyx_t_1;
11010  PyObject *__pyx_t_2 = NULL;
11011  PyObject *__pyx_t_3 = NULL;
11012  PyObject *__pyx_t_4 = NULL;
11013  int __pyx_lineno = 0;
11014  const char *__pyx_filename = NULL;
11015  int __pyx_clineno = 0;
11016  __Pyx_RefNannySetupContext("__setitem__", 0);
11017  __Pyx_INCREF(__pyx_v_index);
11018 
11019  /* "View.MemoryView":417
11020  *
11021  * def __setitem__(memoryview self, object index, object value):
11022  * if self.view.readonly: # <<<<<<<<<<<<<<
11023  * raise TypeError("Cannot assign to read-only memoryview")
11024  *
11025  */
11026  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11027  if (unlikely(__pyx_t_1)) {
11028 
11029  /* "View.MemoryView":418
11030  * def __setitem__(memoryview self, object index, object value):
11031  * if self.view.readonly:
11032  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
11033  *
11034  * have_slices, index = _unellipsify(index, self.view.ndim)
11035  */
11036  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
11037  __Pyx_GOTREF(__pyx_t_2);
11038  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11039  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11040  __PYX_ERR(1, 418, __pyx_L1_error)
11041 
11042  /* "View.MemoryView":417
11043  *
11044  * def __setitem__(memoryview self, object index, object value):
11045  * if self.view.readonly: # <<<<<<<<<<<<<<
11046  * raise TypeError("Cannot assign to read-only memoryview")
11047  *
11048  */
11049  }
11050 
11051  /* "View.MemoryView":420
11052  * raise TypeError("Cannot assign to read-only memoryview")
11053  *
11054  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11055  *
11056  * if have_slices:
11057  */
11058  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
11059  __Pyx_GOTREF(__pyx_t_2);
11060  if (likely(__pyx_t_2 != Py_None)) {
11061  PyObject* sequence = __pyx_t_2;
11062  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11063  if (unlikely(size != 2)) {
11064  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11065  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11066  __PYX_ERR(1, 420, __pyx_L1_error)
11067  }
11068  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11069  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
11070  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
11071  __Pyx_INCREF(__pyx_t_3);
11072  __Pyx_INCREF(__pyx_t_4);
11073  #else
11074  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
11075  __Pyx_GOTREF(__pyx_t_3);
11076  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
11077  __Pyx_GOTREF(__pyx_t_4);
11078  #endif
11079  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11080  } else {
11081  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
11082  }
11083  __pyx_v_have_slices = __pyx_t_3;
11084  __pyx_t_3 = 0;
11085  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
11086  __pyx_t_4 = 0;
11087 
11088  /* "View.MemoryView":422
11089  * have_slices, index = _unellipsify(index, self.view.ndim)
11090  *
11091  * if have_slices: # <<<<<<<<<<<<<<
11092  * obj = self.is_slice(value)
11093  * if obj:
11094  */
11095  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
11096  if (__pyx_t_1) {
11097 
11098  /* "View.MemoryView":423
11099  *
11100  * if have_slices:
11101  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
11102  * if obj:
11103  * self.setitem_slice_assignment(self[index], obj)
11104  */
11105  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
11106  __Pyx_GOTREF(__pyx_t_2);
11107  __pyx_v_obj = __pyx_t_2;
11108  __pyx_t_2 = 0;
11109 
11110  /* "View.MemoryView":424
11111  * if have_slices:
11112  * obj = self.is_slice(value)
11113  * if obj: # <<<<<<<<<<<<<<
11114  * self.setitem_slice_assignment(self[index], obj)
11115  * else:
11116  */
11117  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
11118  if (__pyx_t_1) {
11119 
11120  /* "View.MemoryView":425
11121  * obj = self.is_slice(value)
11122  * if obj:
11123  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
11124  * else:
11125  * self.setitem_slice_assign_scalar(self[index], value)
11126  */
11127  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
11128  __Pyx_GOTREF(__pyx_t_2);
11129  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
11130  __Pyx_GOTREF(__pyx_t_4);
11131  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11132  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11133 
11134  /* "View.MemoryView":424
11135  * if have_slices:
11136  * obj = self.is_slice(value)
11137  * if obj: # <<<<<<<<<<<<<<
11138  * self.setitem_slice_assignment(self[index], obj)
11139  * else:
11140  */
11141  goto __pyx_L5;
11142  }
11143 
11144  /* "View.MemoryView":427
11145  * self.setitem_slice_assignment(self[index], obj)
11146  * else:
11147  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
11148  * else:
11149  * self.setitem_indexed(index, value)
11150  */
11151  /*else*/ {
11152  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
11153  __Pyx_GOTREF(__pyx_t_4);
11154  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
11155  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
11156  __Pyx_GOTREF(__pyx_t_2);
11157  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11158  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11159  }
11160  __pyx_L5:;
11161 
11162  /* "View.MemoryView":422
11163  * have_slices, index = _unellipsify(index, self.view.ndim)
11164  *
11165  * if have_slices: # <<<<<<<<<<<<<<
11166  * obj = self.is_slice(value)
11167  * if obj:
11168  */
11169  goto __pyx_L4;
11170  }
11171 
11172  /* "View.MemoryView":429
11173  * self.setitem_slice_assign_scalar(self[index], value)
11174  * else:
11175  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
11176  *
11177  * cdef is_slice(self, obj):
11178  */
11179  /*else*/ {
11180  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
11181  __Pyx_GOTREF(__pyx_t_2);
11182  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11183  }
11184  __pyx_L4:;
11185 
11186  /* "View.MemoryView":416
11187  * return self.convert_item_to_object(itemp)
11188  *
11189  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11190  * if self.view.readonly:
11191  * raise TypeError("Cannot assign to read-only memoryview")
11192  */
11193 
11194  /* function exit code */
11195  __pyx_r = 0;
11196  goto __pyx_L0;
11197  __pyx_L1_error:;
11198  __Pyx_XDECREF(__pyx_t_2);
11199  __Pyx_XDECREF(__pyx_t_3);
11200  __Pyx_XDECREF(__pyx_t_4);
11201  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11202  __pyx_r = -1;
11203  __pyx_L0:;
11204  __Pyx_XDECREF(__pyx_v_have_slices);
11205  __Pyx_XDECREF(__pyx_v_obj);
11206  __Pyx_XDECREF(__pyx_v_index);
11207  __Pyx_RefNannyFinishContext();
11208  return __pyx_r;
11209 }
11210 
11211 /* "View.MemoryView":431
11212  * self.setitem_indexed(index, value)
11213  *
11214  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11215  * if not isinstance(obj, memoryview):
11216  * try:
11217  */
11218 
11219 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
11220  PyObject *__pyx_r = NULL;
11221  __Pyx_RefNannyDeclarations
11222  int __pyx_t_1;
11223  int __pyx_t_2;
11224  PyObject *__pyx_t_3 = NULL;
11225  PyObject *__pyx_t_4 = NULL;
11226  PyObject *__pyx_t_5 = NULL;
11227  PyObject *__pyx_t_6 = NULL;
11228  PyObject *__pyx_t_7 = NULL;
11229  PyObject *__pyx_t_8 = NULL;
11230  int __pyx_t_9;
11231  int __pyx_lineno = 0;
11232  const char *__pyx_filename = NULL;
11233  int __pyx_clineno = 0;
11234  __Pyx_RefNannySetupContext("is_slice", 0);
11235  __Pyx_INCREF(__pyx_v_obj);
11236 
11237  /* "View.MemoryView":432
11238  *
11239  * cdef is_slice(self, obj):
11240  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11241  * try:
11242  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11243  */
11244  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
11245  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11246  if (__pyx_t_2) {
11247 
11248  /* "View.MemoryView":433
11249  * cdef is_slice(self, obj):
11250  * if not isinstance(obj, memoryview):
11251  * try: # <<<<<<<<<<<<<<
11252  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11253  * self.dtype_is_object)
11254  */
11255  {
11256  __Pyx_PyThreadState_declare
11257  __Pyx_PyThreadState_assign
11258  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11259  __Pyx_XGOTREF(__pyx_t_3);
11260  __Pyx_XGOTREF(__pyx_t_4);
11261  __Pyx_XGOTREF(__pyx_t_5);
11262  /*try:*/ {
11263 
11264  /* "View.MemoryView":434
11265  * if not isinstance(obj, memoryview):
11266  * try:
11267  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11268  * self.dtype_is_object)
11269  * except TypeError:
11270  */
11271  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
11272  __Pyx_GOTREF(__pyx_t_6);
11273 
11274  /* "View.MemoryView":435
11275  * try:
11276  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11277  * self.dtype_is_object) # <<<<<<<<<<<<<<
11278  * except TypeError:
11279  * return None
11280  */
11281  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
11282  __Pyx_GOTREF(__pyx_t_7);
11283 
11284  /* "View.MemoryView":434
11285  * if not isinstance(obj, memoryview):
11286  * try:
11287  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11288  * self.dtype_is_object)
11289  * except TypeError:
11290  */
11291  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
11292  __Pyx_GOTREF(__pyx_t_8);
11293  __Pyx_INCREF(__pyx_v_obj);
11294  __Pyx_GIVEREF(__pyx_v_obj);
11295  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
11296  __Pyx_GIVEREF(__pyx_t_6);
11297  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
11298  __Pyx_GIVEREF(__pyx_t_7);
11299  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
11300  __pyx_t_6 = 0;
11301  __pyx_t_7 = 0;
11302  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
11303  __Pyx_GOTREF(__pyx_t_7);
11304  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11305  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
11306  __pyx_t_7 = 0;
11307 
11308  /* "View.MemoryView":433
11309  * cdef is_slice(self, obj):
11310  * if not isinstance(obj, memoryview):
11311  * try: # <<<<<<<<<<<<<<
11312  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11313  * self.dtype_is_object)
11314  */
11315  }
11316  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11317  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11318  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11319  goto __pyx_L9_try_end;
11320  __pyx_L4_error:;
11321  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11322  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11323  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11324 
11325  /* "View.MemoryView":436
11326  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11327  * self.dtype_is_object)
11328  * except TypeError: # <<<<<<<<<<<<<<
11329  * return None
11330  *
11331  */
11332  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
11333  if (__pyx_t_9) {
11334  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11335  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
11336  __Pyx_GOTREF(__pyx_t_7);
11337  __Pyx_GOTREF(__pyx_t_8);
11338  __Pyx_GOTREF(__pyx_t_6);
11339 
11340  /* "View.MemoryView":437
11341  * self.dtype_is_object)
11342  * except TypeError:
11343  * return None # <<<<<<<<<<<<<<
11344  *
11345  * return obj
11346  */
11347  __Pyx_XDECREF(__pyx_r);
11348  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11349  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11350  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11351  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11352  goto __pyx_L7_except_return;
11353  }
11354  goto __pyx_L6_except_error;
11355  __pyx_L6_except_error:;
11356 
11357  /* "View.MemoryView":433
11358  * cdef is_slice(self, obj):
11359  * if not isinstance(obj, memoryview):
11360  * try: # <<<<<<<<<<<<<<
11361  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11362  * self.dtype_is_object)
11363  */
11364  __Pyx_XGIVEREF(__pyx_t_3);
11365  __Pyx_XGIVEREF(__pyx_t_4);
11366  __Pyx_XGIVEREF(__pyx_t_5);
11367  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11368  goto __pyx_L1_error;
11369  __pyx_L7_except_return:;
11370  __Pyx_XGIVEREF(__pyx_t_3);
11371  __Pyx_XGIVEREF(__pyx_t_4);
11372  __Pyx_XGIVEREF(__pyx_t_5);
11373  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11374  goto __pyx_L0;
11375  __pyx_L9_try_end:;
11376  }
11377 
11378  /* "View.MemoryView":432
11379  *
11380  * cdef is_slice(self, obj):
11381  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11382  * try:
11383  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11384  */
11385  }
11386 
11387  /* "View.MemoryView":439
11388  * return None
11389  *
11390  * return obj # <<<<<<<<<<<<<<
11391  *
11392  * cdef setitem_slice_assignment(self, dst, src):
11393  */
11394  __Pyx_XDECREF(__pyx_r);
11395  __Pyx_INCREF(__pyx_v_obj);
11396  __pyx_r = __pyx_v_obj;
11397  goto __pyx_L0;
11398 
11399  /* "View.MemoryView":431
11400  * self.setitem_indexed(index, value)
11401  *
11402  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11403  * if not isinstance(obj, memoryview):
11404  * try:
11405  */
11406 
11407  /* function exit code */
11408  __pyx_L1_error:;
11409  __Pyx_XDECREF(__pyx_t_6);
11410  __Pyx_XDECREF(__pyx_t_7);
11411  __Pyx_XDECREF(__pyx_t_8);
11412  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11413  __pyx_r = 0;
11414  __pyx_L0:;
11415  __Pyx_XDECREF(__pyx_v_obj);
11416  __Pyx_XGIVEREF(__pyx_r);
11417  __Pyx_RefNannyFinishContext();
11418  return __pyx_r;
11419 }
11420 
11421 /* "View.MemoryView":441
11422  * return obj
11423  *
11424  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
11425  * cdef __Pyx_memviewslice dst_slice
11426  * cdef __Pyx_memviewslice src_slice
11427  */
11428 
11429 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
11430  __Pyx_memviewslice __pyx_v_dst_slice;
11431  __Pyx_memviewslice __pyx_v_src_slice;
11432  PyObject *__pyx_r = NULL;
11433  __Pyx_RefNannyDeclarations
11434  __Pyx_memviewslice *__pyx_t_1;
11435  __Pyx_memviewslice *__pyx_t_2;
11436  PyObject *__pyx_t_3 = NULL;
11437  int __pyx_t_4;
11438  int __pyx_t_5;
11439  int __pyx_t_6;
11440  int __pyx_lineno = 0;
11441  const char *__pyx_filename = NULL;
11442  int __pyx_clineno = 0;
11443  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
11444 
11445  /* "View.MemoryView":445
11446  * cdef __Pyx_memviewslice src_slice
11447  *
11448  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
11449  * get_slice_from_memview(dst, &dst_slice)[0],
11450  * src.ndim, dst.ndim, self.dtype_is_object)
11451  */
11452  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
11453  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
11454 
11455  /* "View.MemoryView":446
11456  *
11457  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
11458  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
11459  * src.ndim, dst.ndim, self.dtype_is_object)
11460  *
11461  */
11462  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
11463  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
11464 
11465  /* "View.MemoryView":447
11466  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
11467  * get_slice_from_memview(dst, &dst_slice)[0],
11468  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
11469  *
11470  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
11471  */
11472  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
11473  __Pyx_GOTREF(__pyx_t_3);
11474  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
11475  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11476  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
11477  __Pyx_GOTREF(__pyx_t_3);
11478  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
11479  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11480 
11481  /* "View.MemoryView":445
11482  * cdef __Pyx_memviewslice src_slice
11483  *
11484  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
11485  * get_slice_from_memview(dst, &dst_slice)[0],
11486  * src.ndim, dst.ndim, self.dtype_is_object)
11487  */
11488  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
11489 
11490  /* "View.MemoryView":441
11491  * return obj
11492  *
11493  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
11494  * cdef __Pyx_memviewslice dst_slice
11495  * cdef __Pyx_memviewslice src_slice
11496  */
11497 
11498  /* function exit code */
11499  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11500  goto __pyx_L0;
11501  __pyx_L1_error:;
11502  __Pyx_XDECREF(__pyx_t_3);
11503  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
11504  __pyx_r = 0;
11505  __pyx_L0:;
11506  __Pyx_XGIVEREF(__pyx_r);
11507  __Pyx_RefNannyFinishContext();
11508  return __pyx_r;
11509 }
11510 
11511 /* "View.MemoryView":449
11512  * src.ndim, dst.ndim, self.dtype_is_object)
11513  *
11514  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
11515  * cdef int array[128]
11516  * cdef void *tmp = NULL
11517  */
11518 
11519 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
11520  int __pyx_v_array[0x80];
11521  void *__pyx_v_tmp;
11522  void *__pyx_v_item;
11523  __Pyx_memviewslice *__pyx_v_dst_slice;
11524  __Pyx_memviewslice __pyx_v_tmp_slice;
11525  PyObject *__pyx_r = NULL;
11526  __Pyx_RefNannyDeclarations
11527  __Pyx_memviewslice *__pyx_t_1;
11528  int __pyx_t_2;
11529  PyObject *__pyx_t_3 = NULL;
11530  int __pyx_t_4;
11531  int __pyx_t_5;
11532  char const *__pyx_t_6;
11533  PyObject *__pyx_t_7 = NULL;
11534  PyObject *__pyx_t_8 = NULL;
11535  PyObject *__pyx_t_9 = NULL;
11536  PyObject *__pyx_t_10 = NULL;
11537  PyObject *__pyx_t_11 = NULL;
11538  PyObject *__pyx_t_12 = NULL;
11539  int __pyx_lineno = 0;
11540  const char *__pyx_filename = NULL;
11541  int __pyx_clineno = 0;
11542  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
11543 
11544  /* "View.MemoryView":451
11545  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
11546  * cdef int array[128]
11547  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
11548  * cdef void *item
11549  *
11550  */
11551  __pyx_v_tmp = NULL;
11552 
11553  /* "View.MemoryView":456
11554  * cdef __Pyx_memviewslice *dst_slice
11555  * cdef __Pyx_memviewslice tmp_slice
11556  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
11557  *
11558  * if <size_t>self.view.itemsize > sizeof(array):
11559  */
11560  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
11561  __pyx_v_dst_slice = __pyx_t_1;
11562 
11563  /* "View.MemoryView":458
11564  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
11565  *
11566  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
11567  * tmp = PyMem_Malloc(self.view.itemsize)
11568  * if tmp == NULL:
11569  */
11570  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
11571  if (__pyx_t_2) {
11572 
11573  /* "View.MemoryView":459
11574  *
11575  * if <size_t>self.view.itemsize > sizeof(array):
11576  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
11577  * if tmp == NULL:
11578  * raise MemoryError
11579  */
11580  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
11581 
11582  /* "View.MemoryView":460
11583  * if <size_t>self.view.itemsize > sizeof(array):
11584  * tmp = PyMem_Malloc(self.view.itemsize)
11585  * if tmp == NULL: # <<<<<<<<<<<<<<
11586  * raise MemoryError
11587  * item = tmp
11588  */
11589  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
11590  if (unlikely(__pyx_t_2)) {
11591 
11592  /* "View.MemoryView":461
11593  * tmp = PyMem_Malloc(self.view.itemsize)
11594  * if tmp == NULL:
11595  * raise MemoryError # <<<<<<<<<<<<<<
11596  * item = tmp
11597  * else:
11598  */
11599  PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
11600 
11601  /* "View.MemoryView":460
11602  * if <size_t>self.view.itemsize > sizeof(array):
11603  * tmp = PyMem_Malloc(self.view.itemsize)
11604  * if tmp == NULL: # <<<<<<<<<<<<<<
11605  * raise MemoryError
11606  * item = tmp
11607  */
11608  }
11609 
11610  /* "View.MemoryView":462
11611  * if tmp == NULL:
11612  * raise MemoryError
11613  * item = tmp # <<<<<<<<<<<<<<
11614  * else:
11615  * item = <void *> array
11616  */
11617  __pyx_v_item = __pyx_v_tmp;
11618 
11619  /* "View.MemoryView":458
11620  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
11621  *
11622  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
11623  * tmp = PyMem_Malloc(self.view.itemsize)
11624  * if tmp == NULL:
11625  */
11626  goto __pyx_L3;
11627  }
11628 
11629  /* "View.MemoryView":464
11630  * item = tmp
11631  * else:
11632  * item = <void *> array # <<<<<<<<<<<<<<
11633  *
11634  * try:
11635  */
11636  /*else*/ {
11637  __pyx_v_item = ((void *)__pyx_v_array);
11638  }
11639  __pyx_L3:;
11640 
11641  /* "View.MemoryView":466
11642  * item = <void *> array
11643  *
11644  * try: # <<<<<<<<<<<<<<
11645  * if self.dtype_is_object:
11646  * (<PyObject **> item)[0] = <PyObject *> value
11647  */
11648  /*try:*/ {
11649 
11650  /* "View.MemoryView":467
11651  *
11652  * try:
11653  * if self.dtype_is_object: # <<<<<<<<<<<<<<
11654  * (<PyObject **> item)[0] = <PyObject *> value
11655  * else:
11656  */
11657  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
11658  if (__pyx_t_2) {
11659 
11660  /* "View.MemoryView":468
11661  * try:
11662  * if self.dtype_is_object:
11663  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
11664  * else:
11665  * self.assign_item_from_object(<char *> item, value)
11666  */
11667  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
11668 
11669  /* "View.MemoryView":467
11670  *
11671  * try:
11672  * if self.dtype_is_object: # <<<<<<<<<<<<<<
11673  * (<PyObject **> item)[0] = <PyObject *> value
11674  * else:
11675  */
11676  goto __pyx_L8;
11677  }
11678 
11679  /* "View.MemoryView":470
11680  * (<PyObject **> item)[0] = <PyObject *> value
11681  * else:
11682  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
11683  *
11684  *
11685  */
11686  /*else*/ {
11687  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
11688  __Pyx_GOTREF(__pyx_t_3);
11689  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11690  }
11691  __pyx_L8:;
11692 
11693  /* "View.MemoryView":474
11694  *
11695  *
11696  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
11697  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11698  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11699  */
11700  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
11701  if (__pyx_t_2) {
11702 
11703  /* "View.MemoryView":475
11704  *
11705  * if self.view.suboffsets != NULL:
11706  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
11707  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11708  * item, self.dtype_is_object)
11709  */
11710  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
11711  __Pyx_GOTREF(__pyx_t_3);
11712  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11713 
11714  /* "View.MemoryView":474
11715  *
11716  *
11717  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
11718  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11719  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11720  */
11721  }
11722 
11723  /* "View.MemoryView":476
11724  * if self.view.suboffsets != NULL:
11725  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11726  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
11727  * item, self.dtype_is_object)
11728  * finally:
11729  */
11730  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
11731  }
11732 
11733  /* "View.MemoryView":479
11734  * item, self.dtype_is_object)
11735  * finally:
11736  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
11737  *
11738  * cdef setitem_indexed(self, index, value):
11739  */
11740  /*finally:*/ {
11741  /*normal exit:*/{
11742  PyMem_Free(__pyx_v_tmp);
11743  goto __pyx_L7;
11744  }
11745  __pyx_L6_error:;
11746  /*exception exit:*/{
11747  __Pyx_PyThreadState_declare
11748  __Pyx_PyThreadState_assign
11749  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11750  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11751  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
11752  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
11753  __Pyx_XGOTREF(__pyx_t_7);
11754  __Pyx_XGOTREF(__pyx_t_8);
11755  __Pyx_XGOTREF(__pyx_t_9);
11756  __Pyx_XGOTREF(__pyx_t_10);
11757  __Pyx_XGOTREF(__pyx_t_11);
11758  __Pyx_XGOTREF(__pyx_t_12);
11759  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
11760  {
11761  PyMem_Free(__pyx_v_tmp);
11762  }
11763  if (PY_MAJOR_VERSION >= 3) {
11764  __Pyx_XGIVEREF(__pyx_t_10);
11765  __Pyx_XGIVEREF(__pyx_t_11);
11766  __Pyx_XGIVEREF(__pyx_t_12);
11767  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
11768  }
11769  __Pyx_XGIVEREF(__pyx_t_7);
11770  __Pyx_XGIVEREF(__pyx_t_8);
11771  __Pyx_XGIVEREF(__pyx_t_9);
11772  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
11773  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11774  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
11775  goto __pyx_L1_error;
11776  }
11777  __pyx_L7:;
11778  }
11779 
11780  /* "View.MemoryView":449
11781  * src.ndim, dst.ndim, self.dtype_is_object)
11782  *
11783  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
11784  * cdef int array[128]
11785  * cdef void *tmp = NULL
11786  */
11787 
11788  /* function exit code */
11789  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11790  goto __pyx_L0;
11791  __pyx_L1_error:;
11792  __Pyx_XDECREF(__pyx_t_3);
11793  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11794  __pyx_r = 0;
11795  __pyx_L0:;
11796  __Pyx_XGIVEREF(__pyx_r);
11797  __Pyx_RefNannyFinishContext();
11798  return __pyx_r;
11799 }
11800 
11801 /* "View.MemoryView":481
11802  * PyMem_Free(tmp)
11803  *
11804  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
11805  * cdef char *itemp = self.get_item_pointer(index)
11806  * self.assign_item_from_object(itemp, value)
11807  */
11808 
11809 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11810  char *__pyx_v_itemp;
11811  PyObject *__pyx_r = NULL;
11812  __Pyx_RefNannyDeclarations
11813  char *__pyx_t_1;
11814  PyObject *__pyx_t_2 = NULL;
11815  int __pyx_lineno = 0;
11816  const char *__pyx_filename = NULL;
11817  int __pyx_clineno = 0;
11818  __Pyx_RefNannySetupContext("setitem_indexed", 0);
11819 
11820  /* "View.MemoryView":482
11821  *
11822  * cdef setitem_indexed(self, index, value):
11823  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
11824  * self.assign_item_from_object(itemp, value)
11825  *
11826  */
11827  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
11828  __pyx_v_itemp = __pyx_t_1;
11829 
11830  /* "View.MemoryView":483
11831  * cdef setitem_indexed(self, index, value):
11832  * cdef char *itemp = self.get_item_pointer(index)
11833  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
11834  *
11835  * cdef convert_item_to_object(self, char *itemp):
11836  */
11837  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
11838  __Pyx_GOTREF(__pyx_t_2);
11839  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11840 
11841  /* "View.MemoryView":481
11842  * PyMem_Free(tmp)
11843  *
11844  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
11845  * cdef char *itemp = self.get_item_pointer(index)
11846  * self.assign_item_from_object(itemp, value)
11847  */
11848 
11849  /* function exit code */
11850  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11851  goto __pyx_L0;
11852  __pyx_L1_error:;
11853  __Pyx_XDECREF(__pyx_t_2);
11854  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
11855  __pyx_r = 0;
11856  __pyx_L0:;
11857  __Pyx_XGIVEREF(__pyx_r);
11858  __Pyx_RefNannyFinishContext();
11859  return __pyx_r;
11860 }
11861 
11862 /* "View.MemoryView":485
11863  * self.assign_item_from_object(itemp, value)
11864  *
11865  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
11866  * """Only used if instantiated manually by the user, or if Cython doesn't
11867  * know how to convert the type"""
11868  */
11869 
11870 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
11871  PyObject *__pyx_v_struct = NULL;
11872  PyObject *__pyx_v_bytesitem = 0;
11873  PyObject *__pyx_v_result = NULL;
11874  PyObject *__pyx_r = NULL;
11875  __Pyx_RefNannyDeclarations
11876  PyObject *__pyx_t_1 = NULL;
11877  PyObject *__pyx_t_2 = NULL;
11878  PyObject *__pyx_t_3 = NULL;
11879  PyObject *__pyx_t_4 = NULL;
11880  PyObject *__pyx_t_5 = NULL;
11881  PyObject *__pyx_t_6 = NULL;
11882  PyObject *__pyx_t_7 = NULL;
11883  int __pyx_t_8;
11884  PyObject *__pyx_t_9 = NULL;
11885  size_t __pyx_t_10;
11886  int __pyx_t_11;
11887  int __pyx_lineno = 0;
11888  const char *__pyx_filename = NULL;
11889  int __pyx_clineno = 0;
11890  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
11891 
11892  /* "View.MemoryView":488
11893  * """Only used if instantiated manually by the user, or if Cython doesn't
11894  * know how to convert the type"""
11895  * import struct # <<<<<<<<<<<<<<
11896  * cdef bytes bytesitem
11897  *
11898  */
11899  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
11900  __Pyx_GOTREF(__pyx_t_1);
11901  __pyx_v_struct = __pyx_t_1;
11902  __pyx_t_1 = 0;
11903 
11904  /* "View.MemoryView":491
11905  * cdef bytes bytesitem
11906  *
11907  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
11908  * try:
11909  * result = struct.unpack(self.view.format, bytesitem)
11910  */
11911  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
11912  __Pyx_GOTREF(__pyx_t_1);
11913  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
11914  __pyx_t_1 = 0;
11915 
11916  /* "View.MemoryView":492
11917  *
11918  * bytesitem = itemp[:self.view.itemsize]
11919  * try: # <<<<<<<<<<<<<<
11920  * result = struct.unpack(self.view.format, bytesitem)
11921  * except struct.error:
11922  */
11923  {
11924  __Pyx_PyThreadState_declare
11925  __Pyx_PyThreadState_assign
11926  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
11927  __Pyx_XGOTREF(__pyx_t_2);
11928  __Pyx_XGOTREF(__pyx_t_3);
11929  __Pyx_XGOTREF(__pyx_t_4);
11930  /*try:*/ {
11931 
11932  /* "View.MemoryView":493
11933  * bytesitem = itemp[:self.view.itemsize]
11934  * try:
11935  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
11936  * except struct.error:
11937  * raise ValueError("Unable to convert item to object")
11938  */
11939  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
11940  __Pyx_GOTREF(__pyx_t_5);
11941  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
11942  __Pyx_GOTREF(__pyx_t_6);
11943  __pyx_t_7 = NULL;
11944  __pyx_t_8 = 0;
11945  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11946  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
11947  if (likely(__pyx_t_7)) {
11948  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
11949  __Pyx_INCREF(__pyx_t_7);
11950  __Pyx_INCREF(function);
11951  __Pyx_DECREF_SET(__pyx_t_5, function);
11952  __pyx_t_8 = 1;
11953  }
11954  }
11955  #if CYTHON_FAST_PYCALL
11956  if (PyFunction_Check(__pyx_t_5)) {
11957  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
11958  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
11959  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11960  __Pyx_GOTREF(__pyx_t_1);
11961  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11962  } else
11963  #endif
11964  #if CYTHON_FAST_PYCCALL
11965  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
11966  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
11967  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
11968  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11969  __Pyx_GOTREF(__pyx_t_1);
11970  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11971  } else
11972  #endif
11973  {
11974  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
11975  __Pyx_GOTREF(__pyx_t_9);
11976  if (__pyx_t_7) {
11977  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
11978  }
11979  __Pyx_GIVEREF(__pyx_t_6);
11980  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
11981  __Pyx_INCREF(__pyx_v_bytesitem);
11982  __Pyx_GIVEREF(__pyx_v_bytesitem);
11983  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
11984  __pyx_t_6 = 0;
11985  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
11986  __Pyx_GOTREF(__pyx_t_1);
11987  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11988  }
11989  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11990  __pyx_v_result = __pyx_t_1;
11991  __pyx_t_1 = 0;
11992 
11993  /* "View.MemoryView":492
11994  *
11995  * bytesitem = itemp[:self.view.itemsize]
11996  * try: # <<<<<<<<<<<<<<
11997  * result = struct.unpack(self.view.format, bytesitem)
11998  * except struct.error:
11999  */
12000  }
12001 
12002  /* "View.MemoryView":497
12003  * raise ValueError("Unable to convert item to object")
12004  * else:
12005  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12006  * return result[0]
12007  * return result
12008  */
12009  /*else:*/ {
12010  __pyx_t_10 = strlen(__pyx_v_self->view.format);
12011  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12012  if (__pyx_t_11) {
12013 
12014  /* "View.MemoryView":498
12015  * else:
12016  * if len(self.view.format) == 1:
12017  * return result[0] # <<<<<<<<<<<<<<
12018  * return result
12019  *
12020  */
12021  __Pyx_XDECREF(__pyx_r);
12022  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
12023  __Pyx_GOTREF(__pyx_t_1);
12024  __pyx_r = __pyx_t_1;
12025  __pyx_t_1 = 0;
12026  goto __pyx_L6_except_return;
12027 
12028  /* "View.MemoryView":497
12029  * raise ValueError("Unable to convert item to object")
12030  * else:
12031  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12032  * return result[0]
12033  * return result
12034  */
12035  }
12036 
12037  /* "View.MemoryView":499
12038  * if len(self.view.format) == 1:
12039  * return result[0]
12040  * return result # <<<<<<<<<<<<<<
12041  *
12042  * cdef assign_item_from_object(self, char *itemp, object value):
12043  */
12044  __Pyx_XDECREF(__pyx_r);
12045  __Pyx_INCREF(__pyx_v_result);
12046  __pyx_r = __pyx_v_result;
12047  goto __pyx_L6_except_return;
12048  }
12049  __pyx_L3_error:;
12050  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12051  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12052  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12053  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12054  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12055 
12056  /* "View.MemoryView":494
12057  * try:
12058  * result = struct.unpack(self.view.format, bytesitem)
12059  * except struct.error: # <<<<<<<<<<<<<<
12060  * raise ValueError("Unable to convert item to object")
12061  * else:
12062  */
12063  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12064  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
12065  __Pyx_GOTREF(__pyx_t_6);
12066  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
12067  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12068  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
12069  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
12070  if (__pyx_t_8) {
12071  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12072  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
12073  __Pyx_GOTREF(__pyx_t_9);
12074  __Pyx_GOTREF(__pyx_t_5);
12075  __Pyx_GOTREF(__pyx_t_1);
12076 
12077  /* "View.MemoryView":495
12078  * result = struct.unpack(self.view.format, bytesitem)
12079  * except struct.error:
12080  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
12081  * else:
12082  * if len(self.view.format) == 1:
12083  */
12084  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
12085  __Pyx_GOTREF(__pyx_t_6);
12086  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
12087  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12088  __PYX_ERR(1, 495, __pyx_L5_except_error)
12089  }
12090  goto __pyx_L5_except_error;
12091  __pyx_L5_except_error:;
12092 
12093  /* "View.MemoryView":492
12094  *
12095  * bytesitem = itemp[:self.view.itemsize]
12096  * try: # <<<<<<<<<<<<<<
12097  * result = struct.unpack(self.view.format, bytesitem)
12098  * except struct.error:
12099  */
12100  __Pyx_XGIVEREF(__pyx_t_2);
12101  __Pyx_XGIVEREF(__pyx_t_3);
12102  __Pyx_XGIVEREF(__pyx_t_4);
12103  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12104  goto __pyx_L1_error;
12105  __pyx_L6_except_return:;
12106  __Pyx_XGIVEREF(__pyx_t_2);
12107  __Pyx_XGIVEREF(__pyx_t_3);
12108  __Pyx_XGIVEREF(__pyx_t_4);
12109  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12110  goto __pyx_L0;
12111  }
12112 
12113  /* "View.MemoryView":485
12114  * self.assign_item_from_object(itemp, value)
12115  *
12116  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12117  * """Only used if instantiated manually by the user, or if Cython doesn't
12118  * know how to convert the type"""
12119  */
12120 
12121  /* function exit code */
12122  __pyx_L1_error:;
12123  __Pyx_XDECREF(__pyx_t_1);
12124  __Pyx_XDECREF(__pyx_t_5);
12125  __Pyx_XDECREF(__pyx_t_6);
12126  __Pyx_XDECREF(__pyx_t_7);
12127  __Pyx_XDECREF(__pyx_t_9);
12128  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12129  __pyx_r = 0;
12130  __pyx_L0:;
12131  __Pyx_XDECREF(__pyx_v_struct);
12132  __Pyx_XDECREF(__pyx_v_bytesitem);
12133  __Pyx_XDECREF(__pyx_v_result);
12134  __Pyx_XGIVEREF(__pyx_r);
12135  __Pyx_RefNannyFinishContext();
12136  return __pyx_r;
12137 }
12138 
12139 /* "View.MemoryView":501
12140  * return result
12141  *
12142  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12143  * """Only used if instantiated manually by the user, or if Cython doesn't
12144  * know how to convert the type"""
12145  */
12146 
12147 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
12148  PyObject *__pyx_v_struct = NULL;
12149  char __pyx_v_c;
12150  PyObject *__pyx_v_bytesvalue = 0;
12151  Py_ssize_t __pyx_v_i;
12152  PyObject *__pyx_r = NULL;
12153  __Pyx_RefNannyDeclarations
12154  PyObject *__pyx_t_1 = NULL;
12155  int __pyx_t_2;
12156  int __pyx_t_3;
12157  PyObject *__pyx_t_4 = NULL;
12158  PyObject *__pyx_t_5 = NULL;
12159  PyObject *__pyx_t_6 = NULL;
12160  int __pyx_t_7;
12161  PyObject *__pyx_t_8 = NULL;
12162  Py_ssize_t __pyx_t_9;
12163  PyObject *__pyx_t_10 = NULL;
12164  char *__pyx_t_11;
12165  char *__pyx_t_12;
12166  char *__pyx_t_13;
12167  char *__pyx_t_14;
12168  int __pyx_lineno = 0;
12169  const char *__pyx_filename = NULL;
12170  int __pyx_clineno = 0;
12171  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
12172 
12173  /* "View.MemoryView":504
12174  * """Only used if instantiated manually by the user, or if Cython doesn't
12175  * know how to convert the type"""
12176  * import struct # <<<<<<<<<<<<<<
12177  * cdef char c
12178  * cdef bytes bytesvalue
12179  */
12180  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
12181  __Pyx_GOTREF(__pyx_t_1);
12182  __pyx_v_struct = __pyx_t_1;
12183  __pyx_t_1 = 0;
12184 
12185  /* "View.MemoryView":509
12186  * cdef Py_ssize_t i
12187  *
12188  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12189  * bytesvalue = struct.pack(self.view.format, *value)
12190  * else:
12191  */
12192  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
12193  __pyx_t_3 = (__pyx_t_2 != 0);
12194  if (__pyx_t_3) {
12195 
12196  /* "View.MemoryView":510
12197  *
12198  * if isinstance(value, tuple):
12199  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
12200  * else:
12201  * bytesvalue = struct.pack(self.view.format, value)
12202  */
12203  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
12204  __Pyx_GOTREF(__pyx_t_1);
12205  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12206  __Pyx_GOTREF(__pyx_t_4);
12207  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
12208  __Pyx_GOTREF(__pyx_t_5);
12209  __Pyx_GIVEREF(__pyx_t_4);
12210  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12211  __pyx_t_4 = 0;
12212  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12213  __Pyx_GOTREF(__pyx_t_4);
12214  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
12215  __Pyx_GOTREF(__pyx_t_6);
12216  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12217  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12218  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12219  __Pyx_GOTREF(__pyx_t_4);
12220  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12221  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12222  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
12223  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12224  __pyx_t_4 = 0;
12225 
12226  /* "View.MemoryView":509
12227  * cdef Py_ssize_t i
12228  *
12229  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12230  * bytesvalue = struct.pack(self.view.format, *value)
12231  * else:
12232  */
12233  goto __pyx_L3;
12234  }
12235 
12236  /* "View.MemoryView":512
12237  * bytesvalue = struct.pack(self.view.format, *value)
12238  * else:
12239  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
12240  *
12241  * for i, c in enumerate(bytesvalue):
12242  */
12243  /*else*/ {
12244  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
12245  __Pyx_GOTREF(__pyx_t_6);
12246  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
12247  __Pyx_GOTREF(__pyx_t_1);
12248  __pyx_t_5 = NULL;
12249  __pyx_t_7 = 0;
12250  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12251  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12252  if (likely(__pyx_t_5)) {
12253  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
12254  __Pyx_INCREF(__pyx_t_5);
12255  __Pyx_INCREF(function);
12256  __Pyx_DECREF_SET(__pyx_t_6, function);
12257  __pyx_t_7 = 1;
12258  }
12259  }
12260  #if CYTHON_FAST_PYCALL
12261  if (PyFunction_Check(__pyx_t_6)) {
12262  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12263  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12264  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12265  __Pyx_GOTREF(__pyx_t_4);
12266  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12267  } else
12268  #endif
12269  #if CYTHON_FAST_PYCCALL
12270  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12271  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12272  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12273  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12274  __Pyx_GOTREF(__pyx_t_4);
12275  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12276  } else
12277  #endif
12278  {
12279  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
12280  __Pyx_GOTREF(__pyx_t_8);
12281  if (__pyx_t_5) {
12282  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12283  }
12284  __Pyx_GIVEREF(__pyx_t_1);
12285  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
12286  __Pyx_INCREF(__pyx_v_value);
12287  __Pyx_GIVEREF(__pyx_v_value);
12288  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
12289  __pyx_t_1 = 0;
12290  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12291  __Pyx_GOTREF(__pyx_t_4);
12292  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12293  }
12294  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12295  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
12296  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12297  __pyx_t_4 = 0;
12298  }
12299  __pyx_L3:;
12300 
12301  /* "View.MemoryView":514
12302  * bytesvalue = struct.pack(self.view.format, value)
12303  *
12304  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12305  * itemp[i] = c
12306  *
12307  */
12308  __pyx_t_9 = 0;
12309  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
12310  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
12311  __PYX_ERR(1, 514, __pyx_L1_error)
12312  }
12313  __Pyx_INCREF(__pyx_v_bytesvalue);
12314  __pyx_t_10 = __pyx_v_bytesvalue;
12315  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12316  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12317  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12318  __pyx_t_11 = __pyx_t_14;
12319  __pyx_v_c = (__pyx_t_11[0]);
12320 
12321  /* "View.MemoryView":515
12322  *
12323  * for i, c in enumerate(bytesvalue):
12324  * itemp[i] = c # <<<<<<<<<<<<<<
12325  *
12326  * @cname('getbuffer')
12327  */
12328  __pyx_v_i = __pyx_t_9;
12329 
12330  /* "View.MemoryView":514
12331  * bytesvalue = struct.pack(self.view.format, value)
12332  *
12333  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12334  * itemp[i] = c
12335  *
12336  */
12337  __pyx_t_9 = (__pyx_t_9 + 1);
12338 
12339  /* "View.MemoryView":515
12340  *
12341  * for i, c in enumerate(bytesvalue):
12342  * itemp[i] = c # <<<<<<<<<<<<<<
12343  *
12344  * @cname('getbuffer')
12345  */
12346  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12347  }
12348  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12349 
12350  /* "View.MemoryView":501
12351  * return result
12352  *
12353  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12354  * """Only used if instantiated manually by the user, or if Cython doesn't
12355  * know how to convert the type"""
12356  */
12357 
12358  /* function exit code */
12359  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12360  goto __pyx_L0;
12361  __pyx_L1_error:;
12362  __Pyx_XDECREF(__pyx_t_1);
12363  __Pyx_XDECREF(__pyx_t_4);
12364  __Pyx_XDECREF(__pyx_t_5);
12365  __Pyx_XDECREF(__pyx_t_6);
12366  __Pyx_XDECREF(__pyx_t_8);
12367  __Pyx_XDECREF(__pyx_t_10);
12368  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12369  __pyx_r = 0;
12370  __pyx_L0:;
12371  __Pyx_XDECREF(__pyx_v_struct);
12372  __Pyx_XDECREF(__pyx_v_bytesvalue);
12373  __Pyx_XGIVEREF(__pyx_r);
12374  __Pyx_RefNannyFinishContext();
12375  return __pyx_r;
12376 }
12377 
12378 /* "View.MemoryView":518
12379  *
12380  * @cname('getbuffer')
12381  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12382  * if flags & PyBUF_WRITABLE and self.view.readonly:
12383  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12384  */
12385 
12386 /* Python wrapper */
12387 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
12388 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12389  int __pyx_r;
12390  __Pyx_RefNannyDeclarations
12391  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
12392  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
12393 
12394  /* function exit code */
12395  __Pyx_RefNannyFinishContext();
12396  return __pyx_r;
12397 }
12398 
12399 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12400  int __pyx_r;
12401  __Pyx_RefNannyDeclarations
12402  int __pyx_t_1;
12403  int __pyx_t_2;
12404  PyObject *__pyx_t_3 = NULL;
12405  Py_ssize_t *__pyx_t_4;
12406  char *__pyx_t_5;
12407  void *__pyx_t_6;
12408  int __pyx_t_7;
12409  Py_ssize_t __pyx_t_8;
12410  int __pyx_lineno = 0;
12411  const char *__pyx_filename = NULL;
12412  int __pyx_clineno = 0;
12413  if (__pyx_v_info == NULL) {
12414  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
12415  return -1;
12416  }
12417  __Pyx_RefNannySetupContext("__getbuffer__", 0);
12418  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12419  __Pyx_GIVEREF(__pyx_v_info->obj);
12420 
12421  /* "View.MemoryView":519
12422  * @cname('getbuffer')
12423  * def __getbuffer__(self, Py_buffer *info, int flags):
12424  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
12425  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12426  *
12427  */
12428  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
12429  if (__pyx_t_2) {
12430  } else {
12431  __pyx_t_1 = __pyx_t_2;
12432  goto __pyx_L4_bool_binop_done;
12433  }
12434  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
12435  __pyx_t_1 = __pyx_t_2;
12436  __pyx_L4_bool_binop_done:;
12437  if (unlikely(__pyx_t_1)) {
12438 
12439  /* "View.MemoryView":520
12440  * def __getbuffer__(self, Py_buffer *info, int flags):
12441  * if flags & PyBUF_WRITABLE and self.view.readonly:
12442  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
12443  *
12444  * if flags & PyBUF_ND:
12445  */
12446  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
12447  __Pyx_GOTREF(__pyx_t_3);
12448  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12449  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12450  __PYX_ERR(1, 520, __pyx_L1_error)
12451 
12452  /* "View.MemoryView":519
12453  * @cname('getbuffer')
12454  * def __getbuffer__(self, Py_buffer *info, int flags):
12455  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
12456  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12457  *
12458  */
12459  }
12460 
12461  /* "View.MemoryView":522
12462  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12463  *
12464  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
12465  * info.shape = self.view.shape
12466  * else:
12467  */
12468  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
12469  if (__pyx_t_1) {
12470 
12471  /* "View.MemoryView":523
12472  *
12473  * if flags & PyBUF_ND:
12474  * info.shape = self.view.shape # <<<<<<<<<<<<<<
12475  * else:
12476  * info.shape = NULL
12477  */
12478  __pyx_t_4 = __pyx_v_self->view.shape;
12479  __pyx_v_info->shape = __pyx_t_4;
12480 
12481  /* "View.MemoryView":522
12482  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12483  *
12484  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
12485  * info.shape = self.view.shape
12486  * else:
12487  */
12488  goto __pyx_L6;
12489  }
12490 
12491  /* "View.MemoryView":525
12492  * info.shape = self.view.shape
12493  * else:
12494  * info.shape = NULL # <<<<<<<<<<<<<<
12495  *
12496  * if flags & PyBUF_STRIDES:
12497  */
12498  /*else*/ {
12499  __pyx_v_info->shape = NULL;
12500  }
12501  __pyx_L6:;
12502 
12503  /* "View.MemoryView":527
12504  * info.shape = NULL
12505  *
12506  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12507  * info.strides = self.view.strides
12508  * else:
12509  */
12510  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12511  if (__pyx_t_1) {
12512 
12513  /* "View.MemoryView":528
12514  *
12515  * if flags & PyBUF_STRIDES:
12516  * info.strides = self.view.strides # <<<<<<<<<<<<<<
12517  * else:
12518  * info.strides = NULL
12519  */
12520  __pyx_t_4 = __pyx_v_self->view.strides;
12521  __pyx_v_info->strides = __pyx_t_4;
12522 
12523  /* "View.MemoryView":527
12524  * info.shape = NULL
12525  *
12526  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12527  * info.strides = self.view.strides
12528  * else:
12529  */
12530  goto __pyx_L7;
12531  }
12532 
12533  /* "View.MemoryView":530
12534  * info.strides = self.view.strides
12535  * else:
12536  * info.strides = NULL # <<<<<<<<<<<<<<
12537  *
12538  * if flags & PyBUF_INDIRECT:
12539  */
12540  /*else*/ {
12541  __pyx_v_info->strides = NULL;
12542  }
12543  __pyx_L7:;
12544 
12545  /* "View.MemoryView":532
12546  * info.strides = NULL
12547  *
12548  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
12549  * info.suboffsets = self.view.suboffsets
12550  * else:
12551  */
12552  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
12553  if (__pyx_t_1) {
12554 
12555  /* "View.MemoryView":533
12556  *
12557  * if flags & PyBUF_INDIRECT:
12558  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
12559  * else:
12560  * info.suboffsets = NULL
12561  */
12562  __pyx_t_4 = __pyx_v_self->view.suboffsets;
12563  __pyx_v_info->suboffsets = __pyx_t_4;
12564 
12565  /* "View.MemoryView":532
12566  * info.strides = NULL
12567  *
12568  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
12569  * info.suboffsets = self.view.suboffsets
12570  * else:
12571  */
12572  goto __pyx_L8;
12573  }
12574 
12575  /* "View.MemoryView":535
12576  * info.suboffsets = self.view.suboffsets
12577  * else:
12578  * info.suboffsets = NULL # <<<<<<<<<<<<<<
12579  *
12580  * if flags & PyBUF_FORMAT:
12581  */
12582  /*else*/ {
12583  __pyx_v_info->suboffsets = NULL;
12584  }
12585  __pyx_L8:;
12586 
12587  /* "View.MemoryView":537
12588  * info.suboffsets = NULL
12589  *
12590  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12591  * info.format = self.view.format
12592  * else:
12593  */
12594  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12595  if (__pyx_t_1) {
12596 
12597  /* "View.MemoryView":538
12598  *
12599  * if flags & PyBUF_FORMAT:
12600  * info.format = self.view.format # <<<<<<<<<<<<<<
12601  * else:
12602  * info.format = NULL
12603  */
12604  __pyx_t_5 = __pyx_v_self->view.format;
12605  __pyx_v_info->format = __pyx_t_5;
12606 
12607  /* "View.MemoryView":537
12608  * info.suboffsets = NULL
12609  *
12610  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12611  * info.format = self.view.format
12612  * else:
12613  */
12614  goto __pyx_L9;
12615  }
12616 
12617  /* "View.MemoryView":540
12618  * info.format = self.view.format
12619  * else:
12620  * info.format = NULL # <<<<<<<<<<<<<<
12621  *
12622  * info.buf = self.view.buf
12623  */
12624  /*else*/ {
12625  __pyx_v_info->format = NULL;
12626  }
12627  __pyx_L9:;
12628 
12629  /* "View.MemoryView":542
12630  * info.format = NULL
12631  *
12632  * info.buf = self.view.buf # <<<<<<<<<<<<<<
12633  * info.ndim = self.view.ndim
12634  * info.itemsize = self.view.itemsize
12635  */
12636  __pyx_t_6 = __pyx_v_self->view.buf;
12637  __pyx_v_info->buf = __pyx_t_6;
12638 
12639  /* "View.MemoryView":543
12640  *
12641  * info.buf = self.view.buf
12642  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
12643  * info.itemsize = self.view.itemsize
12644  * info.len = self.view.len
12645  */
12646  __pyx_t_7 = __pyx_v_self->view.ndim;
12647  __pyx_v_info->ndim = __pyx_t_7;
12648 
12649  /* "View.MemoryView":544
12650  * info.buf = self.view.buf
12651  * info.ndim = self.view.ndim
12652  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
12653  * info.len = self.view.len
12654  * info.readonly = self.view.readonly
12655  */
12656  __pyx_t_8 = __pyx_v_self->view.itemsize;
12657  __pyx_v_info->itemsize = __pyx_t_8;
12658 
12659  /* "View.MemoryView":545
12660  * info.ndim = self.view.ndim
12661  * info.itemsize = self.view.itemsize
12662  * info.len = self.view.len # <<<<<<<<<<<<<<
12663  * info.readonly = self.view.readonly
12664  * info.obj = self
12665  */
12666  __pyx_t_8 = __pyx_v_self->view.len;
12667  __pyx_v_info->len = __pyx_t_8;
12668 
12669  /* "View.MemoryView":546
12670  * info.itemsize = self.view.itemsize
12671  * info.len = self.view.len
12672  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
12673  * info.obj = self
12674  *
12675  */
12676  __pyx_t_1 = __pyx_v_self->view.readonly;
12677  __pyx_v_info->readonly = __pyx_t_1;
12678 
12679  /* "View.MemoryView":547
12680  * info.len = self.view.len
12681  * info.readonly = self.view.readonly
12682  * info.obj = self # <<<<<<<<<<<<<<
12683  *
12684  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
12685  */
12686  __Pyx_INCREF(((PyObject *)__pyx_v_self));
12687  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12688  __Pyx_GOTREF(__pyx_v_info->obj);
12689  __Pyx_DECREF(__pyx_v_info->obj);
12690  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
12691 
12692  /* "View.MemoryView":518
12693  *
12694  * @cname('getbuffer')
12695  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12696  * if flags & PyBUF_WRITABLE and self.view.readonly:
12697  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12698  */
12699 
12700  /* function exit code */
12701  __pyx_r = 0;
12702  goto __pyx_L0;
12703  __pyx_L1_error:;
12704  __Pyx_XDECREF(__pyx_t_3);
12705  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12706  __pyx_r = -1;
12707  if (__pyx_v_info->obj != NULL) {
12708  __Pyx_GOTREF(__pyx_v_info->obj);
12709  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12710  }
12711  goto __pyx_L2;
12712  __pyx_L0:;
12713  if (__pyx_v_info->obj == Py_None) {
12714  __Pyx_GOTREF(__pyx_v_info->obj);
12715  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12716  }
12717  __pyx_L2:;
12718  __Pyx_RefNannyFinishContext();
12719  return __pyx_r;
12720 }
12721 
12722 /* "View.MemoryView":553
12723  *
12724  * @property
12725  * def T(self): # <<<<<<<<<<<<<<
12726  * cdef _memoryviewslice result = memoryview_copy(self)
12727  * transpose_memslice(&result.from_slice)
12728  */
12729 
12730 /* Python wrapper */
12731 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
12732 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
12733  PyObject *__pyx_r = 0;
12734  __Pyx_RefNannyDeclarations
12735  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12736  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12737 
12738  /* function exit code */
12739  __Pyx_RefNannyFinishContext();
12740  return __pyx_r;
12741 }
12742 
12743 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12744  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
12745  PyObject *__pyx_r = NULL;
12746  __Pyx_RefNannyDeclarations
12747  PyObject *__pyx_t_1 = NULL;
12748  int __pyx_t_2;
12749  int __pyx_lineno = 0;
12750  const char *__pyx_filename = NULL;
12751  int __pyx_clineno = 0;
12752  __Pyx_RefNannySetupContext("__get__", 0);
12753 
12754  /* "View.MemoryView":554
12755  * @property
12756  * def T(self):
12757  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
12758  * transpose_memslice(&result.from_slice)
12759  * return result
12760  */
12761  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
12762  __Pyx_GOTREF(__pyx_t_1);
12763  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
12764  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
12765  __pyx_t_1 = 0;
12766 
12767  /* "View.MemoryView":555
12768  * def T(self):
12769  * cdef _memoryviewslice result = memoryview_copy(self)
12770  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
12771  * return result
12772  *
12773  */
12774  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
12775 
12776  /* "View.MemoryView":556
12777  * cdef _memoryviewslice result = memoryview_copy(self)
12778  * transpose_memslice(&result.from_slice)
12779  * return result # <<<<<<<<<<<<<<
12780  *
12781  * @property
12782  */
12783  __Pyx_XDECREF(__pyx_r);
12784  __Pyx_INCREF(((PyObject *)__pyx_v_result));
12785  __pyx_r = ((PyObject *)__pyx_v_result);
12786  goto __pyx_L0;
12787 
12788  /* "View.MemoryView":553
12789  *
12790  * @property
12791  * def T(self): # <<<<<<<<<<<<<<
12792  * cdef _memoryviewslice result = memoryview_copy(self)
12793  * transpose_memslice(&result.from_slice)
12794  */
12795 
12796  /* function exit code */
12797  __pyx_L1_error:;
12798  __Pyx_XDECREF(__pyx_t_1);
12799  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12800  __pyx_r = NULL;
12801  __pyx_L0:;
12802  __Pyx_XDECREF((PyObject *)__pyx_v_result);
12803  __Pyx_XGIVEREF(__pyx_r);
12804  __Pyx_RefNannyFinishContext();
12805  return __pyx_r;
12806 }
12807 
12808 /* "View.MemoryView":559
12809  *
12810  * @property
12811  * def base(self): # <<<<<<<<<<<<<<
12812  * return self.obj
12813  *
12814  */
12815 
12816 /* Python wrapper */
12817 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
12818 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
12819  PyObject *__pyx_r = 0;
12820  __Pyx_RefNannyDeclarations
12821  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12822  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12823 
12824  /* function exit code */
12825  __Pyx_RefNannyFinishContext();
12826  return __pyx_r;
12827 }
12828 
12829 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12830  PyObject *__pyx_r = NULL;
12831  __Pyx_RefNannyDeclarations
12832  __Pyx_RefNannySetupContext("__get__", 0);
12833 
12834  /* "View.MemoryView":560
12835  * @property
12836  * def base(self):
12837  * return self.obj # <<<<<<<<<<<<<<
12838  *
12839  * @property
12840  */
12841  __Pyx_XDECREF(__pyx_r);
12842  __Pyx_INCREF(__pyx_v_self->obj);
12843  __pyx_r = __pyx_v_self->obj;
12844  goto __pyx_L0;
12845 
12846  /* "View.MemoryView":559
12847  *
12848  * @property
12849  * def base(self): # <<<<<<<<<<<<<<
12850  * return self.obj
12851  *
12852  */
12853 
12854  /* function exit code */
12855  __pyx_L0:;
12856  __Pyx_XGIVEREF(__pyx_r);
12857  __Pyx_RefNannyFinishContext();
12858  return __pyx_r;
12859 }
12860 
12861 /* "View.MemoryView":563
12862  *
12863  * @property
12864  * def shape(self): # <<<<<<<<<<<<<<
12865  * return tuple([length for length in self.view.shape[:self.view.ndim]])
12866  *
12867  */
12868 
12869 /* Python wrapper */
12870 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
12871 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
12872  PyObject *__pyx_r = 0;
12873  __Pyx_RefNannyDeclarations
12874  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12875  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12876 
12877  /* function exit code */
12878  __Pyx_RefNannyFinishContext();
12879  return __pyx_r;
12880 }
12881 
12882 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12883  Py_ssize_t __pyx_v_length;
12884  PyObject *__pyx_r = NULL;
12885  __Pyx_RefNannyDeclarations
12886  PyObject *__pyx_t_1 = NULL;
12887  Py_ssize_t *__pyx_t_2;
12888  Py_ssize_t *__pyx_t_3;
12889  Py_ssize_t *__pyx_t_4;
12890  PyObject *__pyx_t_5 = NULL;
12891  int __pyx_lineno = 0;
12892  const char *__pyx_filename = NULL;
12893  int __pyx_clineno = 0;
12894  __Pyx_RefNannySetupContext("__get__", 0);
12895 
12896  /* "View.MemoryView":564
12897  * @property
12898  * def shape(self):
12899  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
12900  *
12901  * @property
12902  */
12903  __Pyx_XDECREF(__pyx_r);
12904  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
12905  __Pyx_GOTREF(__pyx_t_1);
12906  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12907  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
12908  __pyx_t_2 = __pyx_t_4;
12909  __pyx_v_length = (__pyx_t_2[0]);
12910  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
12911  __Pyx_GOTREF(__pyx_t_5);
12912  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
12913  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12914  }
12915  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
12916  __Pyx_GOTREF(__pyx_t_5);
12917  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12918  __pyx_r = __pyx_t_5;
12919  __pyx_t_5 = 0;
12920  goto __pyx_L0;
12921 
12922  /* "View.MemoryView":563
12923  *
12924  * @property
12925  * def shape(self): # <<<<<<<<<<<<<<
12926  * return tuple([length for length in self.view.shape[:self.view.ndim]])
12927  *
12928  */
12929 
12930  /* function exit code */
12931  __pyx_L1_error:;
12932  __Pyx_XDECREF(__pyx_t_1);
12933  __Pyx_XDECREF(__pyx_t_5);
12934  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12935  __pyx_r = NULL;
12936  __pyx_L0:;
12937  __Pyx_XGIVEREF(__pyx_r);
12938  __Pyx_RefNannyFinishContext();
12939  return __pyx_r;
12940 }
12941 
12942 /* "View.MemoryView":567
12943  *
12944  * @property
12945  * def strides(self): # <<<<<<<<<<<<<<
12946  * if self.view.strides == NULL:
12947  *
12948  */
12949 
12950 /* Python wrapper */
12951 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
12952 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
12953  PyObject *__pyx_r = 0;
12954  __Pyx_RefNannyDeclarations
12955  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12956  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12957 
12958  /* function exit code */
12959  __Pyx_RefNannyFinishContext();
12960  return __pyx_r;
12961 }
12962 
12963 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12964  Py_ssize_t __pyx_v_stride;
12965  PyObject *__pyx_r = NULL;
12966  __Pyx_RefNannyDeclarations
12967  int __pyx_t_1;
12968  PyObject *__pyx_t_2 = NULL;
12969  Py_ssize_t *__pyx_t_3;
12970  Py_ssize_t *__pyx_t_4;
12971  Py_ssize_t *__pyx_t_5;
12972  PyObject *__pyx_t_6 = NULL;
12973  int __pyx_lineno = 0;
12974  const char *__pyx_filename = NULL;
12975  int __pyx_clineno = 0;
12976  __Pyx_RefNannySetupContext("__get__", 0);
12977 
12978  /* "View.MemoryView":568
12979  * @property
12980  * def strides(self):
12981  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
12982  *
12983  * raise ValueError("Buffer view does not expose strides")
12984  */
12985  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
12986  if (unlikely(__pyx_t_1)) {
12987 
12988  /* "View.MemoryView":570
12989  * if self.view.strides == NULL:
12990  *
12991  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
12992  *
12993  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
12994  */
12995  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
12996  __Pyx_GOTREF(__pyx_t_2);
12997  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
12998  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12999  __PYX_ERR(1, 570, __pyx_L1_error)
13000 
13001  /* "View.MemoryView":568
13002  * @property
13003  * def strides(self):
13004  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13005  *
13006  * raise ValueError("Buffer view does not expose strides")
13007  */
13008  }
13009 
13010  /* "View.MemoryView":572
13011  * raise ValueError("Buffer view does not expose strides")
13012  *
13013  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
13014  *
13015  * @property
13016  */
13017  __Pyx_XDECREF(__pyx_r);
13018  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
13019  __Pyx_GOTREF(__pyx_t_2);
13020  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13021  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13022  __pyx_t_3 = __pyx_t_5;
13023  __pyx_v_stride = (__pyx_t_3[0]);
13024  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13025  __Pyx_GOTREF(__pyx_t_6);
13026  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
13027  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13028  }
13029  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13030  __Pyx_GOTREF(__pyx_t_6);
13031  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13032  __pyx_r = __pyx_t_6;
13033  __pyx_t_6 = 0;
13034  goto __pyx_L0;
13035 
13036  /* "View.MemoryView":567
13037  *
13038  * @property
13039  * def strides(self): # <<<<<<<<<<<<<<
13040  * if self.view.strides == NULL:
13041  *
13042  */
13043 
13044  /* function exit code */
13045  __pyx_L1_error:;
13046  __Pyx_XDECREF(__pyx_t_2);
13047  __Pyx_XDECREF(__pyx_t_6);
13048  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13049  __pyx_r = NULL;
13050  __pyx_L0:;
13051  __Pyx_XGIVEREF(__pyx_r);
13052  __Pyx_RefNannyFinishContext();
13053  return __pyx_r;
13054 }
13055 
13056 /* "View.MemoryView":575
13057  *
13058  * @property
13059  * def suboffsets(self): # <<<<<<<<<<<<<<
13060  * if self.view.suboffsets == NULL:
13061  * return (-1,) * self.view.ndim
13062  */
13063 
13064 /* Python wrapper */
13065 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
13066 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
13067  PyObject *__pyx_r = 0;
13068  __Pyx_RefNannyDeclarations
13069  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13070  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13071 
13072  /* function exit code */
13073  __Pyx_RefNannyFinishContext();
13074  return __pyx_r;
13075 }
13076 
13077 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13078  Py_ssize_t __pyx_v_suboffset;
13079  PyObject *__pyx_r = NULL;
13080  __Pyx_RefNannyDeclarations
13081  int __pyx_t_1;
13082  PyObject *__pyx_t_2 = NULL;
13083  PyObject *__pyx_t_3 = NULL;
13084  Py_ssize_t *__pyx_t_4;
13085  Py_ssize_t *__pyx_t_5;
13086  Py_ssize_t *__pyx_t_6;
13087  int __pyx_lineno = 0;
13088  const char *__pyx_filename = NULL;
13089  int __pyx_clineno = 0;
13090  __Pyx_RefNannySetupContext("__get__", 0);
13091 
13092  /* "View.MemoryView":576
13093  * @property
13094  * def suboffsets(self):
13095  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13096  * return (-1,) * self.view.ndim
13097  *
13098  */
13099  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
13100  if (__pyx_t_1) {
13101 
13102  /* "View.MemoryView":577
13103  * def suboffsets(self):
13104  * if self.view.suboffsets == NULL:
13105  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
13106  *
13107  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
13108  */
13109  __Pyx_XDECREF(__pyx_r);
13110  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
13111  __Pyx_GOTREF(__pyx_t_2);
13112  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__22, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
13113  __Pyx_GOTREF(__pyx_t_3);
13114  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13115  __pyx_r = __pyx_t_3;
13116  __pyx_t_3 = 0;
13117  goto __pyx_L0;
13118 
13119  /* "View.MemoryView":576
13120  * @property
13121  * def suboffsets(self):
13122  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13123  * return (-1,) * self.view.ndim
13124  *
13125  */
13126  }
13127 
13128  /* "View.MemoryView":579
13129  * return (-1,) * self.view.ndim
13130  *
13131  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
13132  *
13133  * @property
13134  */
13135  __Pyx_XDECREF(__pyx_r);
13136  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
13137  __Pyx_GOTREF(__pyx_t_3);
13138  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
13139  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
13140  __pyx_t_4 = __pyx_t_6;
13141  __pyx_v_suboffset = (__pyx_t_4[0]);
13142  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
13143  __Pyx_GOTREF(__pyx_t_2);
13144  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
13145  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13146  }
13147  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
13148  __Pyx_GOTREF(__pyx_t_2);
13149  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13150  __pyx_r = __pyx_t_2;
13151  __pyx_t_2 = 0;
13152  goto __pyx_L0;
13153 
13154  /* "View.MemoryView":575
13155  *
13156  * @property
13157  * def suboffsets(self): # <<<<<<<<<<<<<<
13158  * if self.view.suboffsets == NULL:
13159  * return (-1,) * self.view.ndim
13160  */
13161 
13162  /* function exit code */
13163  __pyx_L1_error:;
13164  __Pyx_XDECREF(__pyx_t_2);
13165  __Pyx_XDECREF(__pyx_t_3);
13166  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13167  __pyx_r = NULL;
13168  __pyx_L0:;
13169  __Pyx_XGIVEREF(__pyx_r);
13170  __Pyx_RefNannyFinishContext();
13171  return __pyx_r;
13172 }
13173 
13174 /* "View.MemoryView":582
13175  *
13176  * @property
13177  * def ndim(self): # <<<<<<<<<<<<<<
13178  * return self.view.ndim
13179  *
13180  */
13181 
13182 /* Python wrapper */
13183 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
13184 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13185  PyObject *__pyx_r = 0;
13186  __Pyx_RefNannyDeclarations
13187  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13188  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13189 
13190  /* function exit code */
13191  __Pyx_RefNannyFinishContext();
13192  return __pyx_r;
13193 }
13194 
13195 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13196  PyObject *__pyx_r = NULL;
13197  __Pyx_RefNannyDeclarations
13198  PyObject *__pyx_t_1 = NULL;
13199  int __pyx_lineno = 0;
13200  const char *__pyx_filename = NULL;
13201  int __pyx_clineno = 0;
13202  __Pyx_RefNannySetupContext("__get__", 0);
13203 
13204  /* "View.MemoryView":583
13205  * @property
13206  * def ndim(self):
13207  * return self.view.ndim # <<<<<<<<<<<<<<
13208  *
13209  * @property
13210  */
13211  __Pyx_XDECREF(__pyx_r);
13212  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
13213  __Pyx_GOTREF(__pyx_t_1);
13214  __pyx_r = __pyx_t_1;
13215  __pyx_t_1 = 0;
13216  goto __pyx_L0;
13217 
13218  /* "View.MemoryView":582
13219  *
13220  * @property
13221  * def ndim(self): # <<<<<<<<<<<<<<
13222  * return self.view.ndim
13223  *
13224  */
13225 
13226  /* function exit code */
13227  __pyx_L1_error:;
13228  __Pyx_XDECREF(__pyx_t_1);
13229  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13230  __pyx_r = NULL;
13231  __pyx_L0:;
13232  __Pyx_XGIVEREF(__pyx_r);
13233  __Pyx_RefNannyFinishContext();
13234  return __pyx_r;
13235 }
13236 
13237 /* "View.MemoryView":586
13238  *
13239  * @property
13240  * def itemsize(self): # <<<<<<<<<<<<<<
13241  * return self.view.itemsize
13242  *
13243  */
13244 
13245 /* Python wrapper */
13246 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
13247 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13248  PyObject *__pyx_r = 0;
13249  __Pyx_RefNannyDeclarations
13250  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13251  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13252 
13253  /* function exit code */
13254  __Pyx_RefNannyFinishContext();
13255  return __pyx_r;
13256 }
13257 
13258 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13259  PyObject *__pyx_r = NULL;
13260  __Pyx_RefNannyDeclarations
13261  PyObject *__pyx_t_1 = NULL;
13262  int __pyx_lineno = 0;
13263  const char *__pyx_filename = NULL;
13264  int __pyx_clineno = 0;
13265  __Pyx_RefNannySetupContext("__get__", 0);
13266 
13267  /* "View.MemoryView":587
13268  * @property
13269  * def itemsize(self):
13270  * return self.view.itemsize # <<<<<<<<<<<<<<
13271  *
13272  * @property
13273  */
13274  __Pyx_XDECREF(__pyx_r);
13275  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
13276  __Pyx_GOTREF(__pyx_t_1);
13277  __pyx_r = __pyx_t_1;
13278  __pyx_t_1 = 0;
13279  goto __pyx_L0;
13280 
13281  /* "View.MemoryView":586
13282  *
13283  * @property
13284  * def itemsize(self): # <<<<<<<<<<<<<<
13285  * return self.view.itemsize
13286  *
13287  */
13288 
13289  /* function exit code */
13290  __pyx_L1_error:;
13291  __Pyx_XDECREF(__pyx_t_1);
13292  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13293  __pyx_r = NULL;
13294  __pyx_L0:;
13295  __Pyx_XGIVEREF(__pyx_r);
13296  __Pyx_RefNannyFinishContext();
13297  return __pyx_r;
13298 }
13299 
13300 /* "View.MemoryView":590
13301  *
13302  * @property
13303  * def nbytes(self): # <<<<<<<<<<<<<<
13304  * return self.size * self.view.itemsize
13305  *
13306  */
13307 
13308 /* Python wrapper */
13309 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
13310 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13311  PyObject *__pyx_r = 0;
13312  __Pyx_RefNannyDeclarations
13313  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13314  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13315 
13316  /* function exit code */
13317  __Pyx_RefNannyFinishContext();
13318  return __pyx_r;
13319 }
13320 
13321 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13322  PyObject *__pyx_r = NULL;
13323  __Pyx_RefNannyDeclarations
13324  PyObject *__pyx_t_1 = NULL;
13325  PyObject *__pyx_t_2 = NULL;
13326  PyObject *__pyx_t_3 = NULL;
13327  int __pyx_lineno = 0;
13328  const char *__pyx_filename = NULL;
13329  int __pyx_clineno = 0;
13330  __Pyx_RefNannySetupContext("__get__", 0);
13331 
13332  /* "View.MemoryView":591
13333  * @property
13334  * def nbytes(self):
13335  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
13336  *
13337  * @property
13338  */
13339  __Pyx_XDECREF(__pyx_r);
13340  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
13341  __Pyx_GOTREF(__pyx_t_1);
13342  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
13343  __Pyx_GOTREF(__pyx_t_2);
13344  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
13345  __Pyx_GOTREF(__pyx_t_3);
13346  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13347  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13348  __pyx_r = __pyx_t_3;
13349  __pyx_t_3 = 0;
13350  goto __pyx_L0;
13351 
13352  /* "View.MemoryView":590
13353  *
13354  * @property
13355  * def nbytes(self): # <<<<<<<<<<<<<<
13356  * return self.size * self.view.itemsize
13357  *
13358  */
13359 
13360  /* function exit code */
13361  __pyx_L1_error:;
13362  __Pyx_XDECREF(__pyx_t_1);
13363  __Pyx_XDECREF(__pyx_t_2);
13364  __Pyx_XDECREF(__pyx_t_3);
13365  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13366  __pyx_r = NULL;
13367  __pyx_L0:;
13368  __Pyx_XGIVEREF(__pyx_r);
13369  __Pyx_RefNannyFinishContext();
13370  return __pyx_r;
13371 }
13372 
13373 /* "View.MemoryView":594
13374  *
13375  * @property
13376  * def size(self): # <<<<<<<<<<<<<<
13377  * if self._size is None:
13378  * result = 1
13379  */
13380 
13381 /* Python wrapper */
13382 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
13383 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
13384  PyObject *__pyx_r = 0;
13385  __Pyx_RefNannyDeclarations
13386  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13387  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13388 
13389  /* function exit code */
13390  __Pyx_RefNannyFinishContext();
13391  return __pyx_r;
13392 }
13393 
13394 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13395  PyObject *__pyx_v_result = NULL;
13396  PyObject *__pyx_v_length = NULL;
13397  PyObject *__pyx_r = NULL;
13398  __Pyx_RefNannyDeclarations
13399  int __pyx_t_1;
13400  int __pyx_t_2;
13401  Py_ssize_t *__pyx_t_3;
13402  Py_ssize_t *__pyx_t_4;
13403  Py_ssize_t *__pyx_t_5;
13404  PyObject *__pyx_t_6 = NULL;
13405  int __pyx_lineno = 0;
13406  const char *__pyx_filename = NULL;
13407  int __pyx_clineno = 0;
13408  __Pyx_RefNannySetupContext("__get__", 0);
13409 
13410  /* "View.MemoryView":595
13411  * @property
13412  * def size(self):
13413  * if self._size is None: # <<<<<<<<<<<<<<
13414  * result = 1
13415  *
13416  */
13417  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
13418  __pyx_t_2 = (__pyx_t_1 != 0);
13419  if (__pyx_t_2) {
13420 
13421  /* "View.MemoryView":596
13422  * def size(self):
13423  * if self._size is None:
13424  * result = 1 # <<<<<<<<<<<<<<
13425  *
13426  * for length in self.view.shape[:self.view.ndim]:
13427  */
13428  __Pyx_INCREF(__pyx_int_1);
13429  __pyx_v_result = __pyx_int_1;
13430 
13431  /* "View.MemoryView":598
13432  * result = 1
13433  *
13434  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
13435  * result *= length
13436  *
13437  */
13438  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13439  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13440  __pyx_t_3 = __pyx_t_5;
13441  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
13442  __Pyx_GOTREF(__pyx_t_6);
13443  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
13444  __pyx_t_6 = 0;
13445 
13446  /* "View.MemoryView":599
13447  *
13448  * for length in self.view.shape[:self.view.ndim]:
13449  * result *= length # <<<<<<<<<<<<<<
13450  *
13451  * self._size = result
13452  */
13453  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
13454  __Pyx_GOTREF(__pyx_t_6);
13455  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
13456  __pyx_t_6 = 0;
13457  }
13458 
13459  /* "View.MemoryView":601
13460  * result *= length
13461  *
13462  * self._size = result # <<<<<<<<<<<<<<
13463  *
13464  * return self._size
13465  */
13466  __Pyx_INCREF(__pyx_v_result);
13467  __Pyx_GIVEREF(__pyx_v_result);
13468  __Pyx_GOTREF(__pyx_v_self->_size);
13469  __Pyx_DECREF(__pyx_v_self->_size);
13470  __pyx_v_self->_size = __pyx_v_result;
13471 
13472  /* "View.MemoryView":595
13473  * @property
13474  * def size(self):
13475  * if self._size is None: # <<<<<<<<<<<<<<
13476  * result = 1
13477  *
13478  */
13479  }
13480 
13481  /* "View.MemoryView":603
13482  * self._size = result
13483  *
13484  * return self._size # <<<<<<<<<<<<<<
13485  *
13486  * def __len__(self):
13487  */
13488  __Pyx_XDECREF(__pyx_r);
13489  __Pyx_INCREF(__pyx_v_self->_size);
13490  __pyx_r = __pyx_v_self->_size;
13491  goto __pyx_L0;
13492 
13493  /* "View.MemoryView":594
13494  *
13495  * @property
13496  * def size(self): # <<<<<<<<<<<<<<
13497  * if self._size is None:
13498  * result = 1
13499  */
13500 
13501  /* function exit code */
13502  __pyx_L1_error:;
13503  __Pyx_XDECREF(__pyx_t_6);
13504  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13505  __pyx_r = NULL;
13506  __pyx_L0:;
13507  __Pyx_XDECREF(__pyx_v_result);
13508  __Pyx_XDECREF(__pyx_v_length);
13509  __Pyx_XGIVEREF(__pyx_r);
13510  __Pyx_RefNannyFinishContext();
13511  return __pyx_r;
13512 }
13513 
13514 /* "View.MemoryView":605
13515  * return self._size
13516  *
13517  * def __len__(self): # <<<<<<<<<<<<<<
13518  * if self.view.ndim >= 1:
13519  * return self.view.shape[0]
13520  */
13521 
13522 /* Python wrapper */
13523 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
13524 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
13525  Py_ssize_t __pyx_r;
13526  __Pyx_RefNannyDeclarations
13527  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
13528  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13529 
13530  /* function exit code */
13531  __Pyx_RefNannyFinishContext();
13532  return __pyx_r;
13533 }
13534 
13535 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
13536  Py_ssize_t __pyx_r;
13537  __Pyx_RefNannyDeclarations
13538  int __pyx_t_1;
13539  __Pyx_RefNannySetupContext("__len__", 0);
13540 
13541  /* "View.MemoryView":606
13542  *
13543  * def __len__(self):
13544  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
13545  * return self.view.shape[0]
13546  *
13547  */
13548  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
13549  if (__pyx_t_1) {
13550 
13551  /* "View.MemoryView":607
13552  * def __len__(self):
13553  * if self.view.ndim >= 1:
13554  * return self.view.shape[0] # <<<<<<<<<<<<<<
13555  *
13556  * return 0
13557  */
13558  __pyx_r = (__pyx_v_self->view.shape[0]);
13559  goto __pyx_L0;
13560 
13561  /* "View.MemoryView":606
13562  *
13563  * def __len__(self):
13564  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
13565  * return self.view.shape[0]
13566  *
13567  */
13568  }
13569 
13570  /* "View.MemoryView":609
13571  * return self.view.shape[0]
13572  *
13573  * return 0 # <<<<<<<<<<<<<<
13574  *
13575  * def __repr__(self):
13576  */
13577  __pyx_r = 0;
13578  goto __pyx_L0;
13579 
13580  /* "View.MemoryView":605
13581  * return self._size
13582  *
13583  * def __len__(self): # <<<<<<<<<<<<<<
13584  * if self.view.ndim >= 1:
13585  * return self.view.shape[0]
13586  */
13587 
13588  /* function exit code */
13589  __pyx_L0:;
13590  __Pyx_RefNannyFinishContext();
13591  return __pyx_r;
13592 }
13593 
13594 /* "View.MemoryView":611
13595  * return 0
13596  *
13597  * def __repr__(self): # <<<<<<<<<<<<<<
13598  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13599  * id(self))
13600  */
13601 
13602 /* Python wrapper */
13603 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
13604 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
13605  PyObject *__pyx_r = 0;
13606  __Pyx_RefNannyDeclarations
13607  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
13608  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13609 
13610  /* function exit code */
13611  __Pyx_RefNannyFinishContext();
13612  return __pyx_r;
13613 }
13614 
13615 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
13616  PyObject *__pyx_r = NULL;
13617  __Pyx_RefNannyDeclarations
13618  PyObject *__pyx_t_1 = NULL;
13619  PyObject *__pyx_t_2 = NULL;
13620  PyObject *__pyx_t_3 = NULL;
13621  int __pyx_lineno = 0;
13622  const char *__pyx_filename = NULL;
13623  int __pyx_clineno = 0;
13624  __Pyx_RefNannySetupContext("__repr__", 0);
13625 
13626  /* "View.MemoryView":612
13627  *
13628  * def __repr__(self):
13629  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
13630  * id(self))
13631  *
13632  */
13633  __Pyx_XDECREF(__pyx_r);
13634  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
13635  __Pyx_GOTREF(__pyx_t_1);
13636  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
13637  __Pyx_GOTREF(__pyx_t_2);
13638  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13639  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
13640  __Pyx_GOTREF(__pyx_t_1);
13641  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13642 
13643  /* "View.MemoryView":613
13644  * def __repr__(self):
13645  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13646  * id(self)) # <<<<<<<<<<<<<<
13647  *
13648  * def __str__(self):
13649  */
13650  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
13651  __Pyx_GOTREF(__pyx_t_2);
13652 
13653  /* "View.MemoryView":612
13654  *
13655  * def __repr__(self):
13656  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
13657  * id(self))
13658  *
13659  */
13660  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
13661  __Pyx_GOTREF(__pyx_t_3);
13662  __Pyx_GIVEREF(__pyx_t_1);
13663  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
13664  __Pyx_GIVEREF(__pyx_t_2);
13665  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
13666  __pyx_t_1 = 0;
13667  __pyx_t_2 = 0;
13668  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
13669  __Pyx_GOTREF(__pyx_t_2);
13670  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13671  __pyx_r = __pyx_t_2;
13672  __pyx_t_2 = 0;
13673  goto __pyx_L0;
13674 
13675  /* "View.MemoryView":611
13676  * return 0
13677  *
13678  * def __repr__(self): # <<<<<<<<<<<<<<
13679  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13680  * id(self))
13681  */
13682 
13683  /* function exit code */
13684  __pyx_L1_error:;
13685  __Pyx_XDECREF(__pyx_t_1);
13686  __Pyx_XDECREF(__pyx_t_2);
13687  __Pyx_XDECREF(__pyx_t_3);
13688  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13689  __pyx_r = NULL;
13690  __pyx_L0:;
13691  __Pyx_XGIVEREF(__pyx_r);
13692  __Pyx_RefNannyFinishContext();
13693  return __pyx_r;
13694 }
13695 
13696 /* "View.MemoryView":615
13697  * id(self))
13698  *
13699  * def __str__(self): # <<<<<<<<<<<<<<
13700  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
13701  *
13702  */
13703 
13704 /* Python wrapper */
13705 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
13706 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
13707  PyObject *__pyx_r = 0;
13708  __Pyx_RefNannyDeclarations
13709  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
13710  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13711 
13712  /* function exit code */
13713  __Pyx_RefNannyFinishContext();
13714  return __pyx_r;
13715 }
13716 
13717 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
13718  PyObject *__pyx_r = NULL;
13719  __Pyx_RefNannyDeclarations
13720  PyObject *__pyx_t_1 = NULL;
13721  PyObject *__pyx_t_2 = NULL;
13722  int __pyx_lineno = 0;
13723  const char *__pyx_filename = NULL;
13724  int __pyx_clineno = 0;
13725  __Pyx_RefNannySetupContext("__str__", 0);
13726 
13727  /* "View.MemoryView":616
13728  *
13729  * def __str__(self):
13730  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
13731  *
13732  *
13733  */
13734  __Pyx_XDECREF(__pyx_r);
13735  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
13736  __Pyx_GOTREF(__pyx_t_1);
13737  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
13738  __Pyx_GOTREF(__pyx_t_2);
13739  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13740  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
13741  __Pyx_GOTREF(__pyx_t_1);
13742  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13743  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
13744  __Pyx_GOTREF(__pyx_t_2);
13745  __Pyx_GIVEREF(__pyx_t_1);
13746  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
13747  __pyx_t_1 = 0;
13748  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
13749  __Pyx_GOTREF(__pyx_t_1);
13750  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13751  __pyx_r = __pyx_t_1;
13752  __pyx_t_1 = 0;
13753  goto __pyx_L0;
13754 
13755  /* "View.MemoryView":615
13756  * id(self))
13757  *
13758  * def __str__(self): # <<<<<<<<<<<<<<
13759  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
13760  *
13761  */
13762 
13763  /* function exit code */
13764  __pyx_L1_error:;
13765  __Pyx_XDECREF(__pyx_t_1);
13766  __Pyx_XDECREF(__pyx_t_2);
13767  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13768  __pyx_r = NULL;
13769  __pyx_L0:;
13770  __Pyx_XGIVEREF(__pyx_r);
13771  __Pyx_RefNannyFinishContext();
13772  return __pyx_r;
13773 }
13774 
13775 /* "View.MemoryView":619
13776  *
13777  *
13778  * def is_c_contig(self): # <<<<<<<<<<<<<<
13779  * cdef __Pyx_memviewslice *mslice
13780  * cdef __Pyx_memviewslice tmp
13781  */
13782 
13783 /* Python wrapper */
13784 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13785 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13786  PyObject *__pyx_r = 0;
13787  __Pyx_RefNannyDeclarations
13788  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
13789  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
13790 
13791  /* function exit code */
13792  __Pyx_RefNannyFinishContext();
13793  return __pyx_r;
13794 }
13795 
13796 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
13797  __Pyx_memviewslice *__pyx_v_mslice;
13798  __Pyx_memviewslice __pyx_v_tmp;
13799  PyObject *__pyx_r = NULL;
13800  __Pyx_RefNannyDeclarations
13801  __Pyx_memviewslice *__pyx_t_1;
13802  PyObject *__pyx_t_2 = NULL;
13803  int __pyx_lineno = 0;
13804  const char *__pyx_filename = NULL;
13805  int __pyx_clineno = 0;
13806  __Pyx_RefNannySetupContext("is_c_contig", 0);
13807 
13808  /* "View.MemoryView":622
13809  * cdef __Pyx_memviewslice *mslice
13810  * cdef __Pyx_memviewslice tmp
13811  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
13812  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
13813  *
13814  */
13815  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
13816  __pyx_v_mslice = __pyx_t_1;
13817 
13818  /* "View.MemoryView":623
13819  * cdef __Pyx_memviewslice tmp
13820  * mslice = get_slice_from_memview(self, &tmp)
13821  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
13822  *
13823  * def is_f_contig(self):
13824  */
13825  __Pyx_XDECREF(__pyx_r);
13826  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
13827  __Pyx_GOTREF(__pyx_t_2);
13828  __pyx_r = __pyx_t_2;
13829  __pyx_t_2 = 0;
13830  goto __pyx_L0;
13831 
13832  /* "View.MemoryView":619
13833  *
13834  *
13835  * def is_c_contig(self): # <<<<<<<<<<<<<<
13836  * cdef __Pyx_memviewslice *mslice
13837  * cdef __Pyx_memviewslice tmp
13838  */
13839 
13840  /* function exit code */
13841  __pyx_L1_error:;
13842  __Pyx_XDECREF(__pyx_t_2);
13843  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13844  __pyx_r = NULL;
13845  __pyx_L0:;
13846  __Pyx_XGIVEREF(__pyx_r);
13847  __Pyx_RefNannyFinishContext();
13848  return __pyx_r;
13849 }
13850 
13851 /* "View.MemoryView":625
13852  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
13853  *
13854  * def is_f_contig(self): # <<<<<<<<<<<<<<
13855  * cdef __Pyx_memviewslice *mslice
13856  * cdef __Pyx_memviewslice tmp
13857  */
13858 
13859 /* Python wrapper */
13860 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13861 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13862  PyObject *__pyx_r = 0;
13863  __Pyx_RefNannyDeclarations
13864  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
13865  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
13866 
13867  /* function exit code */
13868  __Pyx_RefNannyFinishContext();
13869  return __pyx_r;
13870 }
13871 
13872 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
13873  __Pyx_memviewslice *__pyx_v_mslice;
13874  __Pyx_memviewslice __pyx_v_tmp;
13875  PyObject *__pyx_r = NULL;
13876  __Pyx_RefNannyDeclarations
13877  __Pyx_memviewslice *__pyx_t_1;
13878  PyObject *__pyx_t_2 = NULL;
13879  int __pyx_lineno = 0;
13880  const char *__pyx_filename = NULL;
13881  int __pyx_clineno = 0;
13882  __Pyx_RefNannySetupContext("is_f_contig", 0);
13883 
13884  /* "View.MemoryView":628
13885  * cdef __Pyx_memviewslice *mslice
13886  * cdef __Pyx_memviewslice tmp
13887  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
13888  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
13889  *
13890  */
13891  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
13892  __pyx_v_mslice = __pyx_t_1;
13893 
13894  /* "View.MemoryView":629
13895  * cdef __Pyx_memviewslice tmp
13896  * mslice = get_slice_from_memview(self, &tmp)
13897  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
13898  *
13899  * def copy(self):
13900  */
13901  __Pyx_XDECREF(__pyx_r);
13902  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
13903  __Pyx_GOTREF(__pyx_t_2);
13904  __pyx_r = __pyx_t_2;
13905  __pyx_t_2 = 0;
13906  goto __pyx_L0;
13907 
13908  /* "View.MemoryView":625
13909  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
13910  *
13911  * def is_f_contig(self): # <<<<<<<<<<<<<<
13912  * cdef __Pyx_memviewslice *mslice
13913  * cdef __Pyx_memviewslice tmp
13914  */
13915 
13916  /* function exit code */
13917  __pyx_L1_error:;
13918  __Pyx_XDECREF(__pyx_t_2);
13919  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13920  __pyx_r = NULL;
13921  __pyx_L0:;
13922  __Pyx_XGIVEREF(__pyx_r);
13923  __Pyx_RefNannyFinishContext();
13924  return __pyx_r;
13925 }
13926 
13927 /* "View.MemoryView":631
13928  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
13929  *
13930  * def copy(self): # <<<<<<<<<<<<<<
13931  * cdef __Pyx_memviewslice mslice
13932  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13933  */
13934 
13935 /* Python wrapper */
13936 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13937 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13938  PyObject *__pyx_r = 0;
13939  __Pyx_RefNannyDeclarations
13940  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
13941  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
13942 
13943  /* function exit code */
13944  __Pyx_RefNannyFinishContext();
13945  return __pyx_r;
13946 }
13947 
13948 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
13949  __Pyx_memviewslice __pyx_v_mslice;
13950  int __pyx_v_flags;
13951  PyObject *__pyx_r = NULL;
13952  __Pyx_RefNannyDeclarations
13953  __Pyx_memviewslice __pyx_t_1;
13954  PyObject *__pyx_t_2 = NULL;
13955  int __pyx_lineno = 0;
13956  const char *__pyx_filename = NULL;
13957  int __pyx_clineno = 0;
13958  __Pyx_RefNannySetupContext("copy", 0);
13959 
13960  /* "View.MemoryView":633
13961  * def copy(self):
13962  * cdef __Pyx_memviewslice mslice
13963  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
13964  *
13965  * slice_copy(self, &mslice)
13966  */
13967  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
13968 
13969  /* "View.MemoryView":635
13970  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13971  *
13972  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
13973  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
13974  * self.view.itemsize,
13975  */
13976  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
13977 
13978  /* "View.MemoryView":636
13979  *
13980  * slice_copy(self, &mslice)
13981  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
13982  * self.view.itemsize,
13983  * flags|PyBUF_C_CONTIGUOUS,
13984  */
13985  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
13986  __pyx_v_mslice = __pyx_t_1;
13987 
13988  /* "View.MemoryView":641
13989  * self.dtype_is_object)
13990  *
13991  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
13992  *
13993  * def copy_fortran(self):
13994  */
13995  __Pyx_XDECREF(__pyx_r);
13996  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
13997  __Pyx_GOTREF(__pyx_t_2);
13998  __pyx_r = __pyx_t_2;
13999  __pyx_t_2 = 0;
14000  goto __pyx_L0;
14001 
14002  /* "View.MemoryView":631
14003  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14004  *
14005  * def copy(self): # <<<<<<<<<<<<<<
14006  * cdef __Pyx_memviewslice mslice
14007  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14008  */
14009 
14010  /* function exit code */
14011  __pyx_L1_error:;
14012  __Pyx_XDECREF(__pyx_t_2);
14013  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14014  __pyx_r = NULL;
14015  __pyx_L0:;
14016  __Pyx_XGIVEREF(__pyx_r);
14017  __Pyx_RefNannyFinishContext();
14018  return __pyx_r;
14019 }
14020 
14021 /* "View.MemoryView":643
14022  * return memoryview_copy_from_slice(self, &mslice)
14023  *
14024  * def copy_fortran(self): # <<<<<<<<<<<<<<
14025  * cdef __Pyx_memviewslice src, dst
14026  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14027  */
14028 
14029 /* Python wrapper */
14030 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14031 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14032  PyObject *__pyx_r = 0;
14033  __Pyx_RefNannyDeclarations
14034  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
14035  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
14036 
14037  /* function exit code */
14038  __Pyx_RefNannyFinishContext();
14039  return __pyx_r;
14040 }
14041 
14042 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
14043  __Pyx_memviewslice __pyx_v_src;
14044  __Pyx_memviewslice __pyx_v_dst;
14045  int __pyx_v_flags;
14046  PyObject *__pyx_r = NULL;
14047  __Pyx_RefNannyDeclarations
14048  __Pyx_memviewslice __pyx_t_1;
14049  PyObject *__pyx_t_2 = NULL;
14050  int __pyx_lineno = 0;
14051  const char *__pyx_filename = NULL;
14052  int __pyx_clineno = 0;
14053  __Pyx_RefNannySetupContext("copy_fortran", 0);
14054 
14055  /* "View.MemoryView":645
14056  * def copy_fortran(self):
14057  * cdef __Pyx_memviewslice src, dst
14058  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
14059  *
14060  * slice_copy(self, &src)
14061  */
14062  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
14063 
14064  /* "View.MemoryView":647
14065  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14066  *
14067  * slice_copy(self, &src) # <<<<<<<<<<<<<<
14068  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
14069  * self.view.itemsize,
14070  */
14071  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
14072 
14073  /* "View.MemoryView":648
14074  *
14075  * slice_copy(self, &src)
14076  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
14077  * self.view.itemsize,
14078  * flags|PyBUF_F_CONTIGUOUS,
14079  */
14080  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
14081  __pyx_v_dst = __pyx_t_1;
14082 
14083  /* "View.MemoryView":653
14084  * self.dtype_is_object)
14085  *
14086  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
14087  *
14088  *
14089  */
14090  __Pyx_XDECREF(__pyx_r);
14091  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
14092  __Pyx_GOTREF(__pyx_t_2);
14093  __pyx_r = __pyx_t_2;
14094  __pyx_t_2 = 0;
14095  goto __pyx_L0;
14096 
14097  /* "View.MemoryView":643
14098  * return memoryview_copy_from_slice(self, &mslice)
14099  *
14100  * def copy_fortran(self): # <<<<<<<<<<<<<<
14101  * cdef __Pyx_memviewslice src, dst
14102  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14103  */
14104 
14105  /* function exit code */
14106  __pyx_L1_error:;
14107  __Pyx_XDECREF(__pyx_t_2);
14108  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14109  __pyx_r = NULL;
14110  __pyx_L0:;
14111  __Pyx_XGIVEREF(__pyx_r);
14112  __Pyx_RefNannyFinishContext();
14113  return __pyx_r;
14114 }
14115 
14116 /* "(tree fragment)":1
14117  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14118  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14119  * def __setstate_cython__(self, __pyx_state):
14120  */
14121 
14122 /* Python wrapper */
14123 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14124 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14125  PyObject *__pyx_r = 0;
14126  __Pyx_RefNannyDeclarations
14127  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14128  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14129 
14130  /* function exit code */
14131  __Pyx_RefNannyFinishContext();
14132  return __pyx_r;
14133 }
14134 
14135 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
14136  PyObject *__pyx_r = NULL;
14137  __Pyx_RefNannyDeclarations
14138  PyObject *__pyx_t_1 = NULL;
14139  int __pyx_lineno = 0;
14140  const char *__pyx_filename = NULL;
14141  int __pyx_clineno = 0;
14142  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14143 
14144  /* "(tree fragment)":2
14145  * def __reduce_cython__(self):
14146  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14147  * def __setstate_cython__(self, __pyx_state):
14148  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14149  */
14150  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
14151  __Pyx_GOTREF(__pyx_t_1);
14152  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14153  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14154  __PYX_ERR(1, 2, __pyx_L1_error)
14155 
14156  /* "(tree fragment)":1
14157  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14158  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14159  * def __setstate_cython__(self, __pyx_state):
14160  */
14161 
14162  /* function exit code */
14163  __pyx_L1_error:;
14164  __Pyx_XDECREF(__pyx_t_1);
14165  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14166  __pyx_r = NULL;
14167  __Pyx_XGIVEREF(__pyx_r);
14168  __Pyx_RefNannyFinishContext();
14169  return __pyx_r;
14170 }
14171 
14172 /* "(tree fragment)":3
14173  * def __reduce_cython__(self):
14174  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14175  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14176  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14177  */
14178 
14179 /* Python wrapper */
14180 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
14181 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14182  PyObject *__pyx_r = 0;
14183  __Pyx_RefNannyDeclarations
14184  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14185  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14186 
14187  /* function exit code */
14188  __Pyx_RefNannyFinishContext();
14189  return __pyx_r;
14190 }
14191 
14192 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14193  PyObject *__pyx_r = NULL;
14194  __Pyx_RefNannyDeclarations
14195  PyObject *__pyx_t_1 = NULL;
14196  int __pyx_lineno = 0;
14197  const char *__pyx_filename = NULL;
14198  int __pyx_clineno = 0;
14199  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
14200 
14201  /* "(tree fragment)":4
14202  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14203  * def __setstate_cython__(self, __pyx_state):
14204  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14205  */
14206  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
14207  __Pyx_GOTREF(__pyx_t_1);
14208  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14209  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14210  __PYX_ERR(1, 4, __pyx_L1_error)
14211 
14212  /* "(tree fragment)":3
14213  * def __reduce_cython__(self):
14214  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14215  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14216  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14217  */
14218 
14219  /* function exit code */
14220  __pyx_L1_error:;
14221  __Pyx_XDECREF(__pyx_t_1);
14222  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14223  __pyx_r = NULL;
14224  __Pyx_XGIVEREF(__pyx_r);
14225  __Pyx_RefNannyFinishContext();
14226  return __pyx_r;
14227 }
14228 
14229 /* "View.MemoryView":657
14230  *
14231  * @cname('__pyx_memoryview_new')
14232  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14233  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14234  * result.typeinfo = typeinfo
14235  */
14236 
14237 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14238  struct __pyx_memoryview_obj *__pyx_v_result = 0;
14239  PyObject *__pyx_r = NULL;
14240  __Pyx_RefNannyDeclarations
14241  PyObject *__pyx_t_1 = NULL;
14242  PyObject *__pyx_t_2 = NULL;
14243  PyObject *__pyx_t_3 = NULL;
14244  int __pyx_lineno = 0;
14245  const char *__pyx_filename = NULL;
14246  int __pyx_clineno = 0;
14247  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
14248 
14249  /* "View.MemoryView":658
14250  * @cname('__pyx_memoryview_new')
14251  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14252  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
14253  * result.typeinfo = typeinfo
14254  * return result
14255  */
14256  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
14257  __Pyx_GOTREF(__pyx_t_1);
14258  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
14259  __Pyx_GOTREF(__pyx_t_2);
14260  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
14261  __Pyx_GOTREF(__pyx_t_3);
14262  __Pyx_INCREF(__pyx_v_o);
14263  __Pyx_GIVEREF(__pyx_v_o);
14264  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14265  __Pyx_GIVEREF(__pyx_t_1);
14266  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14267  __Pyx_GIVEREF(__pyx_t_2);
14268  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14269  __pyx_t_1 = 0;
14270  __pyx_t_2 = 0;
14271  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
14272  __Pyx_GOTREF(__pyx_t_2);
14273  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14274  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14275  __pyx_t_2 = 0;
14276 
14277  /* "View.MemoryView":659
14278  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14279  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14280  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
14281  * return result
14282  *
14283  */
14284  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
14285 
14286  /* "View.MemoryView":660
14287  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14288  * result.typeinfo = typeinfo
14289  * return result # <<<<<<<<<<<<<<
14290  *
14291  * @cname('__pyx_memoryview_check')
14292  */
14293  __Pyx_XDECREF(__pyx_r);
14294  __Pyx_INCREF(((PyObject *)__pyx_v_result));
14295  __pyx_r = ((PyObject *)__pyx_v_result);
14296  goto __pyx_L0;
14297 
14298  /* "View.MemoryView":657
14299  *
14300  * @cname('__pyx_memoryview_new')
14301  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14302  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14303  * result.typeinfo = typeinfo
14304  */
14305 
14306  /* function exit code */
14307  __pyx_L1_error:;
14308  __Pyx_XDECREF(__pyx_t_1);
14309  __Pyx_XDECREF(__pyx_t_2);
14310  __Pyx_XDECREF(__pyx_t_3);
14311  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14312  __pyx_r = 0;
14313  __pyx_L0:;
14314  __Pyx_XDECREF((PyObject *)__pyx_v_result);
14315  __Pyx_XGIVEREF(__pyx_r);
14316  __Pyx_RefNannyFinishContext();
14317  return __pyx_r;
14318 }
14319 
14320 /* "View.MemoryView":663
14321  *
14322  * @cname('__pyx_memoryview_check')
14323  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14324  * return isinstance(o, memoryview)
14325  *
14326  */
14327 
14328 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
14329  int __pyx_r;
14330  __Pyx_RefNannyDeclarations
14331  int __pyx_t_1;
14332  __Pyx_RefNannySetupContext("memoryview_check", 0);
14333 
14334  /* "View.MemoryView":664
14335  * @cname('__pyx_memoryview_check')
14336  * cdef inline bint memoryview_check(object o):
14337  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
14338  *
14339  * cdef tuple _unellipsify(object index, int ndim):
14340  */
14341  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
14342  __pyx_r = __pyx_t_1;
14343  goto __pyx_L0;
14344 
14345  /* "View.MemoryView":663
14346  *
14347  * @cname('__pyx_memoryview_check')
14348  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14349  * return isinstance(o, memoryview)
14350  *
14351  */
14352 
14353  /* function exit code */
14354  __pyx_L0:;
14355  __Pyx_RefNannyFinishContext();
14356  return __pyx_r;
14357 }
14358 
14359 /* "View.MemoryView":666
14360  * return isinstance(o, memoryview)
14361  *
14362  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
14363  * """
14364  * Replace all ellipses with full slices and fill incomplete indices with
14365  */
14366 
14367 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
14368  PyObject *__pyx_v_tup = NULL;
14369  PyObject *__pyx_v_result = NULL;
14370  int __pyx_v_have_slices;
14371  int __pyx_v_seen_ellipsis;
14372  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
14373  PyObject *__pyx_v_item = NULL;
14374  Py_ssize_t __pyx_v_nslices;
14375  PyObject *__pyx_r = NULL;
14376  __Pyx_RefNannyDeclarations
14377  int __pyx_t_1;
14378  int __pyx_t_2;
14379  PyObject *__pyx_t_3 = NULL;
14380  PyObject *__pyx_t_4 = NULL;
14381  Py_ssize_t __pyx_t_5;
14382  PyObject *(*__pyx_t_6)(PyObject *);
14383  PyObject *__pyx_t_7 = NULL;
14384  Py_ssize_t __pyx_t_8;
14385  int __pyx_t_9;
14386  int __pyx_t_10;
14387  PyObject *__pyx_t_11 = NULL;
14388  int __pyx_lineno = 0;
14389  const char *__pyx_filename = NULL;
14390  int __pyx_clineno = 0;
14391  __Pyx_RefNannySetupContext("_unellipsify", 0);
14392 
14393  /* "View.MemoryView":671
14394  * full slices.
14395  * """
14396  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14397  * tup = (index,)
14398  * else:
14399  */
14400  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
14401  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14402  if (__pyx_t_2) {
14403 
14404  /* "View.MemoryView":672
14405  * """
14406  * if not isinstance(index, tuple):
14407  * tup = (index,) # <<<<<<<<<<<<<<
14408  * else:
14409  * tup = index
14410  */
14411  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
14412  __Pyx_GOTREF(__pyx_t_3);
14413  __Pyx_INCREF(__pyx_v_index);
14414  __Pyx_GIVEREF(__pyx_v_index);
14415  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
14416  __pyx_v_tup = __pyx_t_3;
14417  __pyx_t_3 = 0;
14418 
14419  /* "View.MemoryView":671
14420  * full slices.
14421  * """
14422  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14423  * tup = (index,)
14424  * else:
14425  */
14426  goto __pyx_L3;
14427  }
14428 
14429  /* "View.MemoryView":674
14430  * tup = (index,)
14431  * else:
14432  * tup = index # <<<<<<<<<<<<<<
14433  *
14434  * result = []
14435  */
14436  /*else*/ {
14437  __Pyx_INCREF(__pyx_v_index);
14438  __pyx_v_tup = __pyx_v_index;
14439  }
14440  __pyx_L3:;
14441 
14442  /* "View.MemoryView":676
14443  * tup = index
14444  *
14445  * result = [] # <<<<<<<<<<<<<<
14446  * have_slices = False
14447  * seen_ellipsis = False
14448  */
14449  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
14450  __Pyx_GOTREF(__pyx_t_3);
14451  __pyx_v_result = ((PyObject*)__pyx_t_3);
14452  __pyx_t_3 = 0;
14453 
14454  /* "View.MemoryView":677
14455  *
14456  * result = []
14457  * have_slices = False # <<<<<<<<<<<<<<
14458  * seen_ellipsis = False
14459  * for idx, item in enumerate(tup):
14460  */
14461  __pyx_v_have_slices = 0;
14462 
14463  /* "View.MemoryView":678
14464  * result = []
14465  * have_slices = False
14466  * seen_ellipsis = False # <<<<<<<<<<<<<<
14467  * for idx, item in enumerate(tup):
14468  * if item is Ellipsis:
14469  */
14470  __pyx_v_seen_ellipsis = 0;
14471 
14472  /* "View.MemoryView":679
14473  * have_slices = False
14474  * seen_ellipsis = False
14475  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
14476  * if item is Ellipsis:
14477  * if not seen_ellipsis:
14478  */
14479  __Pyx_INCREF(__pyx_int_0);
14480  __pyx_t_3 = __pyx_int_0;
14481  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
14482  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
14483  __pyx_t_6 = NULL;
14484  } else {
14485  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
14486  __Pyx_GOTREF(__pyx_t_4);
14487  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
14488  }
14489  for (;;) {
14490  if (likely(!__pyx_t_6)) {
14491  if (likely(PyList_CheckExact(__pyx_t_4))) {
14492  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
14493  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14494  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
14495  #else
14496  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14497  __Pyx_GOTREF(__pyx_t_7);
14498  #endif
14499  } else {
14500  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
14501  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14502  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
14503  #else
14504  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14505  __Pyx_GOTREF(__pyx_t_7);
14506  #endif
14507  }
14508  } else {
14509  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
14510  if (unlikely(!__pyx_t_7)) {
14511  PyObject* exc_type = PyErr_Occurred();
14512  if (exc_type) {
14513  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14514  else __PYX_ERR(1, 679, __pyx_L1_error)
14515  }
14516  break;
14517  }
14518  __Pyx_GOTREF(__pyx_t_7);
14519  }
14520  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
14521  __pyx_t_7 = 0;
14522  __Pyx_INCREF(__pyx_t_3);
14523  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
14524  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14525  __Pyx_GOTREF(__pyx_t_7);
14526  __Pyx_DECREF(__pyx_t_3);
14527  __pyx_t_3 = __pyx_t_7;
14528  __pyx_t_7 = 0;
14529 
14530  /* "View.MemoryView":680
14531  * seen_ellipsis = False
14532  * for idx, item in enumerate(tup):
14533  * if item is Ellipsis: # <<<<<<<<<<<<<<
14534  * if not seen_ellipsis:
14535  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14536  */
14537  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
14538  __pyx_t_1 = (__pyx_t_2 != 0);
14539  if (__pyx_t_1) {
14540 
14541  /* "View.MemoryView":681
14542  * for idx, item in enumerate(tup):
14543  * if item is Ellipsis:
14544  * if not seen_ellipsis: # <<<<<<<<<<<<<<
14545  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14546  * seen_ellipsis = True
14547  */
14548  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
14549  if (__pyx_t_1) {
14550 
14551  /* "View.MemoryView":682
14552  * if item is Ellipsis:
14553  * if not seen_ellipsis:
14554  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
14555  * seen_ellipsis = True
14556  * else:
14557  */
14558  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
14559  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
14560  __Pyx_GOTREF(__pyx_t_7);
14561  { Py_ssize_t __pyx_temp;
14562  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
14563  __Pyx_INCREF(__pyx_slice__25);
14564  __Pyx_GIVEREF(__pyx_slice__25);
14565  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__25);
14566  }
14567  }
14568  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
14569  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14570 
14571  /* "View.MemoryView":683
14572  * if not seen_ellipsis:
14573  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14574  * seen_ellipsis = True # <<<<<<<<<<<<<<
14575  * else:
14576  * result.append(slice(None))
14577  */
14578  __pyx_v_seen_ellipsis = 1;
14579 
14580  /* "View.MemoryView":681
14581  * for idx, item in enumerate(tup):
14582  * if item is Ellipsis:
14583  * if not seen_ellipsis: # <<<<<<<<<<<<<<
14584  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14585  * seen_ellipsis = True
14586  */
14587  goto __pyx_L7;
14588  }
14589 
14590  /* "View.MemoryView":685
14591  * seen_ellipsis = True
14592  * else:
14593  * result.append(slice(None)) # <<<<<<<<<<<<<<
14594  * have_slices = True
14595  * else:
14596  */
14597  /*else*/ {
14598  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__25); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
14599  }
14600  __pyx_L7:;
14601 
14602  /* "View.MemoryView":686
14603  * else:
14604  * result.append(slice(None))
14605  * have_slices = True # <<<<<<<<<<<<<<
14606  * else:
14607  * if not isinstance(item, slice) and not PyIndex_Check(item):
14608  */
14609  __pyx_v_have_slices = 1;
14610 
14611  /* "View.MemoryView":680
14612  * seen_ellipsis = False
14613  * for idx, item in enumerate(tup):
14614  * if item is Ellipsis: # <<<<<<<<<<<<<<
14615  * if not seen_ellipsis:
14616  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14617  */
14618  goto __pyx_L6;
14619  }
14620 
14621  /* "View.MemoryView":688
14622  * have_slices = True
14623  * else:
14624  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
14625  * raise TypeError("Cannot index with type '%s'" % type(item))
14626  *
14627  */
14628  /*else*/ {
14629  __pyx_t_2 = PySlice_Check(__pyx_v_item);
14630  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
14631  if (__pyx_t_10) {
14632  } else {
14633  __pyx_t_1 = __pyx_t_10;
14634  goto __pyx_L9_bool_binop_done;
14635  }
14636  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
14637  __pyx_t_1 = __pyx_t_10;
14638  __pyx_L9_bool_binop_done:;
14639  if (unlikely(__pyx_t_1)) {
14640 
14641  /* "View.MemoryView":689
14642  * else:
14643  * if not isinstance(item, slice) and not PyIndex_Check(item):
14644  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
14645  *
14646  * have_slices = have_slices or isinstance(item, slice)
14647  */
14648  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
14649  __Pyx_GOTREF(__pyx_t_7);
14650  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
14651  __Pyx_GOTREF(__pyx_t_11);
14652  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14653  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
14654  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14655  __PYX_ERR(1, 689, __pyx_L1_error)
14656 
14657  /* "View.MemoryView":688
14658  * have_slices = True
14659  * else:
14660  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
14661  * raise TypeError("Cannot index with type '%s'" % type(item))
14662  *
14663  */
14664  }
14665 
14666  /* "View.MemoryView":691
14667  * raise TypeError("Cannot index with type '%s'" % type(item))
14668  *
14669  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
14670  * result.append(item)
14671  *
14672  */
14673  __pyx_t_10 = (__pyx_v_have_slices != 0);
14674  if (!__pyx_t_10) {
14675  } else {
14676  __pyx_t_1 = __pyx_t_10;
14677  goto __pyx_L11_bool_binop_done;
14678  }
14679  __pyx_t_10 = PySlice_Check(__pyx_v_item);
14680  __pyx_t_2 = (__pyx_t_10 != 0);
14681  __pyx_t_1 = __pyx_t_2;
14682  __pyx_L11_bool_binop_done:;
14683  __pyx_v_have_slices = __pyx_t_1;
14684 
14685  /* "View.MemoryView":692
14686  *
14687  * have_slices = have_slices or isinstance(item, slice)
14688  * result.append(item) # <<<<<<<<<<<<<<
14689  *
14690  * nslices = ndim - len(result)
14691  */
14692  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
14693  }
14694  __pyx_L6:;
14695 
14696  /* "View.MemoryView":679
14697  * have_slices = False
14698  * seen_ellipsis = False
14699  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
14700  * if item is Ellipsis:
14701  * if not seen_ellipsis:
14702  */
14703  }
14704  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14705  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14706 
14707  /* "View.MemoryView":694
14708  * result.append(item)
14709  *
14710  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
14711  * if nslices:
14712  * result.extend([slice(None)] * nslices)
14713  */
14714  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
14715  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
14716 
14717  /* "View.MemoryView":695
14718  *
14719  * nslices = ndim - len(result)
14720  * if nslices: # <<<<<<<<<<<<<<
14721  * result.extend([slice(None)] * nslices)
14722  *
14723  */
14724  __pyx_t_1 = (__pyx_v_nslices != 0);
14725  if (__pyx_t_1) {
14726 
14727  /* "View.MemoryView":696
14728  * nslices = ndim - len(result)
14729  * if nslices:
14730  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
14731  *
14732  * return have_slices or nslices, tuple(result)
14733  */
14734  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
14735  __Pyx_GOTREF(__pyx_t_3);
14736  { Py_ssize_t __pyx_temp;
14737  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
14738  __Pyx_INCREF(__pyx_slice__25);
14739  __Pyx_GIVEREF(__pyx_slice__25);
14740  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__25);
14741  }
14742  }
14743  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
14744  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14745 
14746  /* "View.MemoryView":695
14747  *
14748  * nslices = ndim - len(result)
14749  * if nslices: # <<<<<<<<<<<<<<
14750  * result.extend([slice(None)] * nslices)
14751  *
14752  */
14753  }
14754 
14755  /* "View.MemoryView":698
14756  * result.extend([slice(None)] * nslices)
14757  *
14758  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
14759  *
14760  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14761  */
14762  __Pyx_XDECREF(__pyx_r);
14763  if (!__pyx_v_have_slices) {
14764  } else {
14765  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
14766  __Pyx_GOTREF(__pyx_t_4);
14767  __pyx_t_3 = __pyx_t_4;
14768  __pyx_t_4 = 0;
14769  goto __pyx_L14_bool_binop_done;
14770  }
14771  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
14772  __Pyx_GOTREF(__pyx_t_4);
14773  __pyx_t_3 = __pyx_t_4;
14774  __pyx_t_4 = 0;
14775  __pyx_L14_bool_binop_done:;
14776  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
14777  __Pyx_GOTREF(__pyx_t_4);
14778  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
14779  __Pyx_GOTREF(__pyx_t_11);
14780  __Pyx_GIVEREF(__pyx_t_3);
14781  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
14782  __Pyx_GIVEREF(__pyx_t_4);
14783  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
14784  __pyx_t_3 = 0;
14785  __pyx_t_4 = 0;
14786  __pyx_r = ((PyObject*)__pyx_t_11);
14787  __pyx_t_11 = 0;
14788  goto __pyx_L0;
14789 
14790  /* "View.MemoryView":666
14791  * return isinstance(o, memoryview)
14792  *
14793  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
14794  * """
14795  * Replace all ellipses with full slices and fill incomplete indices with
14796  */
14797 
14798  /* function exit code */
14799  __pyx_L1_error:;
14800  __Pyx_XDECREF(__pyx_t_3);
14801  __Pyx_XDECREF(__pyx_t_4);
14802  __Pyx_XDECREF(__pyx_t_7);
14803  __Pyx_XDECREF(__pyx_t_11);
14804  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
14805  __pyx_r = 0;
14806  __pyx_L0:;
14807  __Pyx_XDECREF(__pyx_v_tup);
14808  __Pyx_XDECREF(__pyx_v_result);
14809  __Pyx_XDECREF(__pyx_v_idx);
14810  __Pyx_XDECREF(__pyx_v_item);
14811  __Pyx_XGIVEREF(__pyx_r);
14812  __Pyx_RefNannyFinishContext();
14813  return __pyx_r;
14814 }
14815 
14816 /* "View.MemoryView":700
14817  * return have_slices or nslices, tuple(result)
14818  *
14819  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
14820  * for suboffset in suboffsets[:ndim]:
14821  * if suboffset >= 0:
14822  */
14823 
14824 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
14825  Py_ssize_t __pyx_v_suboffset;
14826  PyObject *__pyx_r = NULL;
14827  __Pyx_RefNannyDeclarations
14828  Py_ssize_t *__pyx_t_1;
14829  Py_ssize_t *__pyx_t_2;
14830  Py_ssize_t *__pyx_t_3;
14831  int __pyx_t_4;
14832  PyObject *__pyx_t_5 = NULL;
14833  int __pyx_lineno = 0;
14834  const char *__pyx_filename = NULL;
14835  int __pyx_clineno = 0;
14836  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
14837 
14838  /* "View.MemoryView":701
14839  *
14840  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14841  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
14842  * if suboffset >= 0:
14843  * raise ValueError("Indirect dimensions not supported")
14844  */
14845  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
14846  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
14847  __pyx_t_1 = __pyx_t_3;
14848  __pyx_v_suboffset = (__pyx_t_1[0]);
14849 
14850  /* "View.MemoryView":702
14851  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14852  * for suboffset in suboffsets[:ndim]:
14853  * if suboffset >= 0: # <<<<<<<<<<<<<<
14854  * raise ValueError("Indirect dimensions not supported")
14855  *
14856  */
14857  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
14858  if (unlikely(__pyx_t_4)) {
14859 
14860  /* "View.MemoryView":703
14861  * for suboffset in suboffsets[:ndim]:
14862  * if suboffset >= 0:
14863  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
14864  *
14865  *
14866  */
14867  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
14868  __Pyx_GOTREF(__pyx_t_5);
14869  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
14870  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14871  __PYX_ERR(1, 703, __pyx_L1_error)
14872 
14873  /* "View.MemoryView":702
14874  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14875  * for suboffset in suboffsets[:ndim]:
14876  * if suboffset >= 0: # <<<<<<<<<<<<<<
14877  * raise ValueError("Indirect dimensions not supported")
14878  *
14879  */
14880  }
14881  }
14882 
14883  /* "View.MemoryView":700
14884  * return have_slices or nslices, tuple(result)
14885  *
14886  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
14887  * for suboffset in suboffsets[:ndim]:
14888  * if suboffset >= 0:
14889  */
14890 
14891  /* function exit code */
14892  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14893  goto __pyx_L0;
14894  __pyx_L1_error:;
14895  __Pyx_XDECREF(__pyx_t_5);
14896  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
14897  __pyx_r = 0;
14898  __pyx_L0:;
14899  __Pyx_XGIVEREF(__pyx_r);
14900  __Pyx_RefNannyFinishContext();
14901  return __pyx_r;
14902 }
14903 
14904 /* "View.MemoryView":710
14905  *
14906  * @cname('__pyx_memview_slice')
14907  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
14908  * cdef int new_ndim = 0, suboffset_dim = -1, dim
14909  * cdef bint negative_step
14910  */
14911 
14912 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
14913  int __pyx_v_new_ndim;
14914  int __pyx_v_suboffset_dim;
14915  int __pyx_v_dim;
14916  __Pyx_memviewslice __pyx_v_src;
14917  __Pyx_memviewslice __pyx_v_dst;
14918  __Pyx_memviewslice *__pyx_v_p_src;
14919  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
14920  __Pyx_memviewslice *__pyx_v_p_dst;
14921  int *__pyx_v_p_suboffset_dim;
14922  Py_ssize_t __pyx_v_start;
14923  Py_ssize_t __pyx_v_stop;
14924  Py_ssize_t __pyx_v_step;
14925  int __pyx_v_have_start;
14926  int __pyx_v_have_stop;
14927  int __pyx_v_have_step;
14928  PyObject *__pyx_v_index = NULL;
14929  struct __pyx_memoryview_obj *__pyx_r = NULL;
14930  __Pyx_RefNannyDeclarations
14931  int __pyx_t_1;
14932  int __pyx_t_2;
14933  PyObject *__pyx_t_3 = NULL;
14934  struct __pyx_memoryview_obj *__pyx_t_4;
14935  char *__pyx_t_5;
14936  int __pyx_t_6;
14937  Py_ssize_t __pyx_t_7;
14938  PyObject *(*__pyx_t_8)(PyObject *);
14939  PyObject *__pyx_t_9 = NULL;
14940  Py_ssize_t __pyx_t_10;
14941  int __pyx_t_11;
14942  Py_ssize_t __pyx_t_12;
14943  int __pyx_lineno = 0;
14944  const char *__pyx_filename = NULL;
14945  int __pyx_clineno = 0;
14946  __Pyx_RefNannySetupContext("memview_slice", 0);
14947 
14948  /* "View.MemoryView":711
14949  * @cname('__pyx_memview_slice')
14950  * cdef memoryview memview_slice(memoryview memview, object indices):
14951  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
14952  * cdef bint negative_step
14953  * cdef __Pyx_memviewslice src, dst
14954  */
14955  __pyx_v_new_ndim = 0;
14956  __pyx_v_suboffset_dim = -1;
14957 
14958  /* "View.MemoryView":718
14959  *
14960  *
14961  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
14962  *
14963  * cdef _memoryviewslice memviewsliceobj
14964  */
14965  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
14966 
14967  /* "View.MemoryView":722
14968  * cdef _memoryviewslice memviewsliceobj
14969  *
14970  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
14971  *
14972  * if isinstance(memview, _memoryviewslice):
14973  */
14974  #ifndef CYTHON_WITHOUT_ASSERTIONS
14975  if (unlikely(!Py_OptimizeFlag)) {
14976  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
14977  PyErr_SetNone(PyExc_AssertionError);
14978  __PYX_ERR(1, 722, __pyx_L1_error)
14979  }
14980  }
14981  #endif
14982 
14983  /* "View.MemoryView":724
14984  * assert memview.view.ndim > 0
14985  *
14986  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14987  * memviewsliceobj = memview
14988  * p_src = &memviewsliceobj.from_slice
14989  */
14990  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14991  __pyx_t_2 = (__pyx_t_1 != 0);
14992  if (__pyx_t_2) {
14993 
14994  /* "View.MemoryView":725
14995  *
14996  * if isinstance(memview, _memoryviewslice):
14997  * memviewsliceobj = memview # <<<<<<<<<<<<<<
14998  * p_src = &memviewsliceobj.from_slice
14999  * else:
15000  */
15001  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
15002  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15003  __Pyx_INCREF(__pyx_t_3);
15004  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15005  __pyx_t_3 = 0;
15006 
15007  /* "View.MemoryView":726
15008  * if isinstance(memview, _memoryviewslice):
15009  * memviewsliceobj = memview
15010  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
15011  * else:
15012  * slice_copy(memview, &src)
15013  */
15014  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15015 
15016  /* "View.MemoryView":724
15017  * assert memview.view.ndim > 0
15018  *
15019  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15020  * memviewsliceobj = memview
15021  * p_src = &memviewsliceobj.from_slice
15022  */
15023  goto __pyx_L3;
15024  }
15025 
15026  /* "View.MemoryView":728
15027  * p_src = &memviewsliceobj.from_slice
15028  * else:
15029  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
15030  * p_src = &src
15031  *
15032  */
15033  /*else*/ {
15034  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15035 
15036  /* "View.MemoryView":729
15037  * else:
15038  * slice_copy(memview, &src)
15039  * p_src = &src # <<<<<<<<<<<<<<
15040  *
15041  *
15042  */
15043  __pyx_v_p_src = (&__pyx_v_src);
15044  }
15045  __pyx_L3:;
15046 
15047  /* "View.MemoryView":735
15048  *
15049  *
15050  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
15051  * dst.data = p_src.data
15052  *
15053  */
15054  __pyx_t_4 = __pyx_v_p_src->memview;
15055  __pyx_v_dst.memview = __pyx_t_4;
15056 
15057  /* "View.MemoryView":736
15058  *
15059  * dst.memview = p_src.memview
15060  * dst.data = p_src.data # <<<<<<<<<<<<<<
15061  *
15062  *
15063  */
15064  __pyx_t_5 = __pyx_v_p_src->data;
15065  __pyx_v_dst.data = __pyx_t_5;
15066 
15067  /* "View.MemoryView":741
15068  *
15069  *
15070  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
15071  * cdef int *p_suboffset_dim = &suboffset_dim
15072  * cdef Py_ssize_t start, stop, step
15073  */
15074  __pyx_v_p_dst = (&__pyx_v_dst);
15075 
15076  /* "View.MemoryView":742
15077  *
15078  * cdef __Pyx_memviewslice *p_dst = &dst
15079  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
15080  * cdef Py_ssize_t start, stop, step
15081  * cdef bint have_start, have_stop, have_step
15082  */
15083  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15084 
15085  /* "View.MemoryView":746
15086  * cdef bint have_start, have_stop, have_step
15087  *
15088  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15089  * if PyIndex_Check(index):
15090  * slice_memviewslice(
15091  */
15092  __pyx_t_6 = 0;
15093  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15094  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15095  __pyx_t_8 = NULL;
15096  } else {
15097  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
15098  __Pyx_GOTREF(__pyx_t_3);
15099  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
15100  }
15101  for (;;) {
15102  if (likely(!__pyx_t_8)) {
15103  if (likely(PyList_CheckExact(__pyx_t_3))) {
15104  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
15105  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15106  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
15107  #else
15108  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
15109  __Pyx_GOTREF(__pyx_t_9);
15110  #endif
15111  } else {
15112  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
15113  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15114  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
15115  #else
15116  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
15117  __Pyx_GOTREF(__pyx_t_9);
15118  #endif
15119  }
15120  } else {
15121  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15122  if (unlikely(!__pyx_t_9)) {
15123  PyObject* exc_type = PyErr_Occurred();
15124  if (exc_type) {
15125  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15126  else __PYX_ERR(1, 746, __pyx_L1_error)
15127  }
15128  break;
15129  }
15130  __Pyx_GOTREF(__pyx_t_9);
15131  }
15132  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15133  __pyx_t_9 = 0;
15134  __pyx_v_dim = __pyx_t_6;
15135  __pyx_t_6 = (__pyx_t_6 + 1);
15136 
15137  /* "View.MemoryView":747
15138  *
15139  * for dim, index in enumerate(indices):
15140  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15141  * slice_memviewslice(
15142  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15143  */
15144  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15145  if (__pyx_t_2) {
15146 
15147  /* "View.MemoryView":751
15148  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15149  * dim, new_ndim, p_suboffset_dim,
15150  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
15151  * 0, 0, 0, # have_{start,stop,step}
15152  * False)
15153  */
15154  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
15155 
15156  /* "View.MemoryView":748
15157  * for dim, index in enumerate(indices):
15158  * if PyIndex_Check(index):
15159  * slice_memviewslice( # <<<<<<<<<<<<<<
15160  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15161  * dim, new_ndim, p_suboffset_dim,
15162  */
15163  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
15164 
15165  /* "View.MemoryView":747
15166  *
15167  * for dim, index in enumerate(indices):
15168  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15169  * slice_memviewslice(
15170  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15171  */
15172  goto __pyx_L6;
15173  }
15174 
15175  /* "View.MemoryView":754
15176  * 0, 0, 0, # have_{start,stop,step}
15177  * False)
15178  * elif index is None: # <<<<<<<<<<<<<<
15179  * p_dst.shape[new_ndim] = 1
15180  * p_dst.strides[new_ndim] = 0
15181  */
15182  __pyx_t_2 = (__pyx_v_index == Py_None);
15183  __pyx_t_1 = (__pyx_t_2 != 0);
15184  if (__pyx_t_1) {
15185 
15186  /* "View.MemoryView":755
15187  * False)
15188  * elif index is None:
15189  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
15190  * p_dst.strides[new_ndim] = 0
15191  * p_dst.suboffsets[new_ndim] = -1
15192  */
15193  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15194 
15195  /* "View.MemoryView":756
15196  * elif index is None:
15197  * p_dst.shape[new_ndim] = 1
15198  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
15199  * p_dst.suboffsets[new_ndim] = -1
15200  * new_ndim += 1
15201  */
15202  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15203 
15204  /* "View.MemoryView":757
15205  * p_dst.shape[new_ndim] = 1
15206  * p_dst.strides[new_ndim] = 0
15207  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
15208  * new_ndim += 1
15209  * else:
15210  */
15211  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
15212 
15213  /* "View.MemoryView":758
15214  * p_dst.strides[new_ndim] = 0
15215  * p_dst.suboffsets[new_ndim] = -1
15216  * new_ndim += 1 # <<<<<<<<<<<<<<
15217  * else:
15218  * start = index.start or 0
15219  */
15220  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15221 
15222  /* "View.MemoryView":754
15223  * 0, 0, 0, # have_{start,stop,step}
15224  * False)
15225  * elif index is None: # <<<<<<<<<<<<<<
15226  * p_dst.shape[new_ndim] = 1
15227  * p_dst.strides[new_ndim] = 0
15228  */
15229  goto __pyx_L6;
15230  }
15231 
15232  /* "View.MemoryView":760
15233  * new_ndim += 1
15234  * else:
15235  * start = index.start or 0 # <<<<<<<<<<<<<<
15236  * stop = index.stop or 0
15237  * step = index.step or 0
15238  */
15239  /*else*/ {
15240  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
15241  __Pyx_GOTREF(__pyx_t_9);
15242  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
15243  if (!__pyx_t_1) {
15244  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15245  } else {
15246  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
15247  __pyx_t_10 = __pyx_t_12;
15248  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15249  goto __pyx_L7_bool_binop_done;
15250  }
15251  __pyx_t_10 = 0;
15252  __pyx_L7_bool_binop_done:;
15253  __pyx_v_start = __pyx_t_10;
15254 
15255  /* "View.MemoryView":761
15256  * else:
15257  * start = index.start or 0
15258  * stop = index.stop or 0 # <<<<<<<<<<<<<<
15259  * step = index.step or 0
15260  *
15261  */
15262  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
15263  __Pyx_GOTREF(__pyx_t_9);
15264  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
15265  if (!__pyx_t_1) {
15266  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15267  } else {
15268  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
15269  __pyx_t_10 = __pyx_t_12;
15270  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15271  goto __pyx_L9_bool_binop_done;
15272  }
15273  __pyx_t_10 = 0;
15274  __pyx_L9_bool_binop_done:;
15275  __pyx_v_stop = __pyx_t_10;
15276 
15277  /* "View.MemoryView":762
15278  * start = index.start or 0
15279  * stop = index.stop or 0
15280  * step = index.step or 0 # <<<<<<<<<<<<<<
15281  *
15282  * have_start = index.start is not None
15283  */
15284  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
15285  __Pyx_GOTREF(__pyx_t_9);
15286  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
15287  if (!__pyx_t_1) {
15288  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15289  } else {
15290  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
15291  __pyx_t_10 = __pyx_t_12;
15292  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15293  goto __pyx_L11_bool_binop_done;
15294  }
15295  __pyx_t_10 = 0;
15296  __pyx_L11_bool_binop_done:;
15297  __pyx_v_step = __pyx_t_10;
15298 
15299  /* "View.MemoryView":764
15300  * step = index.step or 0
15301  *
15302  * have_start = index.start is not None # <<<<<<<<<<<<<<
15303  * have_stop = index.stop is not None
15304  * have_step = index.step is not None
15305  */
15306  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
15307  __Pyx_GOTREF(__pyx_t_9);
15308  __pyx_t_1 = (__pyx_t_9 != Py_None);
15309  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15310  __pyx_v_have_start = __pyx_t_1;
15311 
15312  /* "View.MemoryView":765
15313  *
15314  * have_start = index.start is not None
15315  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
15316  * have_step = index.step is not None
15317  *
15318  */
15319  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
15320  __Pyx_GOTREF(__pyx_t_9);
15321  __pyx_t_1 = (__pyx_t_9 != Py_None);
15322  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15323  __pyx_v_have_stop = __pyx_t_1;
15324 
15325  /* "View.MemoryView":766
15326  * have_start = index.start is not None
15327  * have_stop = index.stop is not None
15328  * have_step = index.step is not None # <<<<<<<<<<<<<<
15329  *
15330  * slice_memviewslice(
15331  */
15332  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
15333  __Pyx_GOTREF(__pyx_t_9);
15334  __pyx_t_1 = (__pyx_t_9 != Py_None);
15335  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15336  __pyx_v_have_step = __pyx_t_1;
15337 
15338  /* "View.MemoryView":768
15339  * have_step = index.step is not None
15340  *
15341  * slice_memviewslice( # <<<<<<<<<<<<<<
15342  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15343  * dim, new_ndim, p_suboffset_dim,
15344  */
15345  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
15346 
15347  /* "View.MemoryView":774
15348  * have_start, have_stop, have_step,
15349  * True)
15350  * new_ndim += 1 # <<<<<<<<<<<<<<
15351  *
15352  * if isinstance(memview, _memoryviewslice):
15353  */
15354  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15355  }
15356  __pyx_L6:;
15357 
15358  /* "View.MemoryView":746
15359  * cdef bint have_start, have_stop, have_step
15360  *
15361  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15362  * if PyIndex_Check(index):
15363  * slice_memviewslice(
15364  */
15365  }
15366  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15367 
15368  /* "View.MemoryView":776
15369  * new_ndim += 1
15370  *
15371  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15372  * return memoryview_fromslice(dst, new_ndim,
15373  * memviewsliceobj.to_object_func,
15374  */
15375  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15376  __pyx_t_2 = (__pyx_t_1 != 0);
15377  if (__pyx_t_2) {
15378 
15379  /* "View.MemoryView":777
15380  *
15381  * if isinstance(memview, _memoryviewslice):
15382  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15383  * memviewsliceobj.to_object_func,
15384  * memviewsliceobj.to_dtype_func,
15385  */
15386  __Pyx_XDECREF(((PyObject *)__pyx_r));
15387 
15388  /* "View.MemoryView":778
15389  * if isinstance(memview, _memoryviewslice):
15390  * return memoryview_fromslice(dst, new_ndim,
15391  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
15392  * memviewsliceobj.to_dtype_func,
15393  * memview.dtype_is_object)
15394  */
15395  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
15396 
15397  /* "View.MemoryView":779
15398  * return memoryview_fromslice(dst, new_ndim,
15399  * memviewsliceobj.to_object_func,
15400  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
15401  * memview.dtype_is_object)
15402  * else:
15403  */
15404  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
15405 
15406  /* "View.MemoryView":777
15407  *
15408  * if isinstance(memview, _memoryviewslice):
15409  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15410  * memviewsliceobj.to_object_func,
15411  * memviewsliceobj.to_dtype_func,
15412  */
15413  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
15414  __Pyx_GOTREF(__pyx_t_3);
15415  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
15416  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15417  __pyx_t_3 = 0;
15418  goto __pyx_L0;
15419 
15420  /* "View.MemoryView":776
15421  * new_ndim += 1
15422  *
15423  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15424  * return memoryview_fromslice(dst, new_ndim,
15425  * memviewsliceobj.to_object_func,
15426  */
15427  }
15428 
15429  /* "View.MemoryView":782
15430  * memview.dtype_is_object)
15431  * else:
15432  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15433  * memview.dtype_is_object)
15434  *
15435  */
15436  /*else*/ {
15437  __Pyx_XDECREF(((PyObject *)__pyx_r));
15438 
15439  /* "View.MemoryView":783
15440  * else:
15441  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
15442  * memview.dtype_is_object) # <<<<<<<<<<<<<<
15443  *
15444  *
15445  */
15446  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
15447  __Pyx_GOTREF(__pyx_t_3);
15448 
15449  /* "View.MemoryView":782
15450  * memview.dtype_is_object)
15451  * else:
15452  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15453  * memview.dtype_is_object)
15454  *
15455  */
15456  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
15457  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15458  __pyx_t_3 = 0;
15459  goto __pyx_L0;
15460  }
15461 
15462  /* "View.MemoryView":710
15463  *
15464  * @cname('__pyx_memview_slice')
15465  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15466  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15467  * cdef bint negative_step
15468  */
15469 
15470  /* function exit code */
15471  __pyx_L1_error:;
15472  __Pyx_XDECREF(__pyx_t_3);
15473  __Pyx_XDECREF(__pyx_t_9);
15474  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15475  __pyx_r = 0;
15476  __pyx_L0:;
15477  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
15478  __Pyx_XDECREF(__pyx_v_index);
15479  __Pyx_XGIVEREF((PyObject *)__pyx_r);
15480  __Pyx_RefNannyFinishContext();
15481  return __pyx_r;
15482 }
15483 
15484 /* "View.MemoryView":807
15485  *
15486  * @cname('__pyx_memoryview_slice_memviewslice')
15487  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
15488  * __Pyx_memviewslice *dst,
15489  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
15490  */
15491 
15492 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
15493  Py_ssize_t __pyx_v_new_shape;
15494  int __pyx_v_negative_step;
15495  int __pyx_r;
15496  int __pyx_t_1;
15497  int __pyx_t_2;
15498  int __pyx_t_3;
15499  int __pyx_lineno = 0;
15500  const char *__pyx_filename = NULL;
15501  int __pyx_clineno = 0;
15502 
15503  /* "View.MemoryView":827
15504  * cdef bint negative_step
15505  *
15506  * if not is_slice: # <<<<<<<<<<<<<<
15507  *
15508  * if start < 0:
15509  */
15510  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
15511  if (__pyx_t_1) {
15512 
15513  /* "View.MemoryView":829
15514  * if not is_slice:
15515  *
15516  * if start < 0: # <<<<<<<<<<<<<<
15517  * start += shape
15518  * if not 0 <= start < shape:
15519  */
15520  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
15521  if (__pyx_t_1) {
15522 
15523  /* "View.MemoryView":830
15524  *
15525  * if start < 0:
15526  * start += shape # <<<<<<<<<<<<<<
15527  * if not 0 <= start < shape:
15528  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15529  */
15530  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15531 
15532  /* "View.MemoryView":829
15533  * if not is_slice:
15534  *
15535  * if start < 0: # <<<<<<<<<<<<<<
15536  * start += shape
15537  * if not 0 <= start < shape:
15538  */
15539  }
15540 
15541  /* "View.MemoryView":831
15542  * if start < 0:
15543  * start += shape
15544  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
15545  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15546  * else:
15547  */
15548  __pyx_t_1 = (0 <= __pyx_v_start);
15549  if (__pyx_t_1) {
15550  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
15551  }
15552  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15553  if (__pyx_t_2) {
15554 
15555  /* "View.MemoryView":832
15556  * start += shape
15557  * if not 0 <= start < shape:
15558  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
15559  * else:
15560  *
15561  */
15562  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
15563 
15564  /* "View.MemoryView":831
15565  * if start < 0:
15566  * start += shape
15567  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
15568  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15569  * else:
15570  */
15571  }
15572 
15573  /* "View.MemoryView":827
15574  * cdef bint negative_step
15575  *
15576  * if not is_slice: # <<<<<<<<<<<<<<
15577  *
15578  * if start < 0:
15579  */
15580  goto __pyx_L3;
15581  }
15582 
15583  /* "View.MemoryView":835
15584  * else:
15585  *
15586  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
15587  *
15588  * if have_step and step == 0:
15589  */
15590  /*else*/ {
15591  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
15592  if (__pyx_t_1) {
15593  } else {
15594  __pyx_t_2 = __pyx_t_1;
15595  goto __pyx_L6_bool_binop_done;
15596  }
15597  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
15598  __pyx_t_2 = __pyx_t_1;
15599  __pyx_L6_bool_binop_done:;
15600  __pyx_v_negative_step = __pyx_t_2;
15601 
15602  /* "View.MemoryView":837
15603  * negative_step = have_step != 0 and step < 0
15604  *
15605  * if have_step and step == 0: # <<<<<<<<<<<<<<
15606  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15607  *
15608  */
15609  __pyx_t_1 = (__pyx_v_have_step != 0);
15610  if (__pyx_t_1) {
15611  } else {
15612  __pyx_t_2 = __pyx_t_1;
15613  goto __pyx_L9_bool_binop_done;
15614  }
15615  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
15616  __pyx_t_2 = __pyx_t_1;
15617  __pyx_L9_bool_binop_done:;
15618  if (__pyx_t_2) {
15619 
15620  /* "View.MemoryView":838
15621  *
15622  * if have_step and step == 0:
15623  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
15624  *
15625  *
15626  */
15627  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
15628 
15629  /* "View.MemoryView":837
15630  * negative_step = have_step != 0 and step < 0
15631  *
15632  * if have_step and step == 0: # <<<<<<<<<<<<<<
15633  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15634  *
15635  */
15636  }
15637 
15638  /* "View.MemoryView":841
15639  *
15640  *
15641  * if have_start: # <<<<<<<<<<<<<<
15642  * if start < 0:
15643  * start += shape
15644  */
15645  __pyx_t_2 = (__pyx_v_have_start != 0);
15646  if (__pyx_t_2) {
15647 
15648  /* "View.MemoryView":842
15649  *
15650  * if have_start:
15651  * if start < 0: # <<<<<<<<<<<<<<
15652  * start += shape
15653  * if start < 0:
15654  */
15655  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15656  if (__pyx_t_2) {
15657 
15658  /* "View.MemoryView":843
15659  * if have_start:
15660  * if start < 0:
15661  * start += shape # <<<<<<<<<<<<<<
15662  * if start < 0:
15663  * start = 0
15664  */
15665  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15666 
15667  /* "View.MemoryView":844
15668  * if start < 0:
15669  * start += shape
15670  * if start < 0: # <<<<<<<<<<<<<<
15671  * start = 0
15672  * elif start >= shape:
15673  */
15674  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15675  if (__pyx_t_2) {
15676 
15677  /* "View.MemoryView":845
15678  * start += shape
15679  * if start < 0:
15680  * start = 0 # <<<<<<<<<<<<<<
15681  * elif start >= shape:
15682  * if negative_step:
15683  */
15684  __pyx_v_start = 0;
15685 
15686  /* "View.MemoryView":844
15687  * if start < 0:
15688  * start += shape
15689  * if start < 0: # <<<<<<<<<<<<<<
15690  * start = 0
15691  * elif start >= shape:
15692  */
15693  }
15694 
15695  /* "View.MemoryView":842
15696  *
15697  * if have_start:
15698  * if start < 0: # <<<<<<<<<<<<<<
15699  * start += shape
15700  * if start < 0:
15701  */
15702  goto __pyx_L12;
15703  }
15704 
15705  /* "View.MemoryView":846
15706  * if start < 0:
15707  * start = 0
15708  * elif start >= shape: # <<<<<<<<<<<<<<
15709  * if negative_step:
15710  * start = shape - 1
15711  */
15712  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
15713  if (__pyx_t_2) {
15714 
15715  /* "View.MemoryView":847
15716  * start = 0
15717  * elif start >= shape:
15718  * if negative_step: # <<<<<<<<<<<<<<
15719  * start = shape - 1
15720  * else:
15721  */
15722  __pyx_t_2 = (__pyx_v_negative_step != 0);
15723  if (__pyx_t_2) {
15724 
15725  /* "View.MemoryView":848
15726  * elif start >= shape:
15727  * if negative_step:
15728  * start = shape - 1 # <<<<<<<<<<<<<<
15729  * else:
15730  * start = shape
15731  */
15732  __pyx_v_start = (__pyx_v_shape - 1);
15733 
15734  /* "View.MemoryView":847
15735  * start = 0
15736  * elif start >= shape:
15737  * if negative_step: # <<<<<<<<<<<<<<
15738  * start = shape - 1
15739  * else:
15740  */
15741  goto __pyx_L14;
15742  }
15743 
15744  /* "View.MemoryView":850
15745  * start = shape - 1
15746  * else:
15747  * start = shape # <<<<<<<<<<<<<<
15748  * else:
15749  * if negative_step:
15750  */
15751  /*else*/ {
15752  __pyx_v_start = __pyx_v_shape;
15753  }
15754  __pyx_L14:;
15755 
15756  /* "View.MemoryView":846
15757  * if start < 0:
15758  * start = 0
15759  * elif start >= shape: # <<<<<<<<<<<<<<
15760  * if negative_step:
15761  * start = shape - 1
15762  */
15763  }
15764  __pyx_L12:;
15765 
15766  /* "View.MemoryView":841
15767  *
15768  *
15769  * if have_start: # <<<<<<<<<<<<<<
15770  * if start < 0:
15771  * start += shape
15772  */
15773  goto __pyx_L11;
15774  }
15775 
15776  /* "View.MemoryView":852
15777  * start = shape
15778  * else:
15779  * if negative_step: # <<<<<<<<<<<<<<
15780  * start = shape - 1
15781  * else:
15782  */
15783  /*else*/ {
15784  __pyx_t_2 = (__pyx_v_negative_step != 0);
15785  if (__pyx_t_2) {
15786 
15787  /* "View.MemoryView":853
15788  * else:
15789  * if negative_step:
15790  * start = shape - 1 # <<<<<<<<<<<<<<
15791  * else:
15792  * start = 0
15793  */
15794  __pyx_v_start = (__pyx_v_shape - 1);
15795 
15796  /* "View.MemoryView":852
15797  * start = shape
15798  * else:
15799  * if negative_step: # <<<<<<<<<<<<<<
15800  * start = shape - 1
15801  * else:
15802  */
15803  goto __pyx_L15;
15804  }
15805 
15806  /* "View.MemoryView":855
15807  * start = shape - 1
15808  * else:
15809  * start = 0 # <<<<<<<<<<<<<<
15810  *
15811  * if have_stop:
15812  */
15813  /*else*/ {
15814  __pyx_v_start = 0;
15815  }
15816  __pyx_L15:;
15817  }
15818  __pyx_L11:;
15819 
15820  /* "View.MemoryView":857
15821  * start = 0
15822  *
15823  * if have_stop: # <<<<<<<<<<<<<<
15824  * if stop < 0:
15825  * stop += shape
15826  */
15827  __pyx_t_2 = (__pyx_v_have_stop != 0);
15828  if (__pyx_t_2) {
15829 
15830  /* "View.MemoryView":858
15831  *
15832  * if have_stop:
15833  * if stop < 0: # <<<<<<<<<<<<<<
15834  * stop += shape
15835  * if stop < 0:
15836  */
15837  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15838  if (__pyx_t_2) {
15839 
15840  /* "View.MemoryView":859
15841  * if have_stop:
15842  * if stop < 0:
15843  * stop += shape # <<<<<<<<<<<<<<
15844  * if stop < 0:
15845  * stop = 0
15846  */
15847  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
15848 
15849  /* "View.MemoryView":860
15850  * if stop < 0:
15851  * stop += shape
15852  * if stop < 0: # <<<<<<<<<<<<<<
15853  * stop = 0
15854  * elif stop > shape:
15855  */
15856  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15857  if (__pyx_t_2) {
15858 
15859  /* "View.MemoryView":861
15860  * stop += shape
15861  * if stop < 0:
15862  * stop = 0 # <<<<<<<<<<<<<<
15863  * elif stop > shape:
15864  * stop = shape
15865  */
15866  __pyx_v_stop = 0;
15867 
15868  /* "View.MemoryView":860
15869  * if stop < 0:
15870  * stop += shape
15871  * if stop < 0: # <<<<<<<<<<<<<<
15872  * stop = 0
15873  * elif stop > shape:
15874  */
15875  }
15876 
15877  /* "View.MemoryView":858
15878  *
15879  * if have_stop:
15880  * if stop < 0: # <<<<<<<<<<<<<<
15881  * stop += shape
15882  * if stop < 0:
15883  */
15884  goto __pyx_L17;
15885  }
15886 
15887  /* "View.MemoryView":862
15888  * if stop < 0:
15889  * stop = 0
15890  * elif stop > shape: # <<<<<<<<<<<<<<
15891  * stop = shape
15892  * else:
15893  */
15894  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
15895  if (__pyx_t_2) {
15896 
15897  /* "View.MemoryView":863
15898  * stop = 0
15899  * elif stop > shape:
15900  * stop = shape # <<<<<<<<<<<<<<
15901  * else:
15902  * if negative_step:
15903  */
15904  __pyx_v_stop = __pyx_v_shape;
15905 
15906  /* "View.MemoryView":862
15907  * if stop < 0:
15908  * stop = 0
15909  * elif stop > shape: # <<<<<<<<<<<<<<
15910  * stop = shape
15911  * else:
15912  */
15913  }
15914  __pyx_L17:;
15915 
15916  /* "View.MemoryView":857
15917  * start = 0
15918  *
15919  * if have_stop: # <<<<<<<<<<<<<<
15920  * if stop < 0:
15921  * stop += shape
15922  */
15923  goto __pyx_L16;
15924  }
15925 
15926  /* "View.MemoryView":865
15927  * stop = shape
15928  * else:
15929  * if negative_step: # <<<<<<<<<<<<<<
15930  * stop = -1
15931  * else:
15932  */
15933  /*else*/ {
15934  __pyx_t_2 = (__pyx_v_negative_step != 0);
15935  if (__pyx_t_2) {
15936 
15937  /* "View.MemoryView":866
15938  * else:
15939  * if negative_step:
15940  * stop = -1 # <<<<<<<<<<<<<<
15941  * else:
15942  * stop = shape
15943  */
15944  __pyx_v_stop = -1L;
15945 
15946  /* "View.MemoryView":865
15947  * stop = shape
15948  * else:
15949  * if negative_step: # <<<<<<<<<<<<<<
15950  * stop = -1
15951  * else:
15952  */
15953  goto __pyx_L19;
15954  }
15955 
15956  /* "View.MemoryView":868
15957  * stop = -1
15958  * else:
15959  * stop = shape # <<<<<<<<<<<<<<
15960  *
15961  * if not have_step:
15962  */
15963  /*else*/ {
15964  __pyx_v_stop = __pyx_v_shape;
15965  }
15966  __pyx_L19:;
15967  }
15968  __pyx_L16:;
15969 
15970  /* "View.MemoryView":870
15971  * stop = shape
15972  *
15973  * if not have_step: # <<<<<<<<<<<<<<
15974  * step = 1
15975  *
15976  */
15977  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
15978  if (__pyx_t_2) {
15979 
15980  /* "View.MemoryView":871
15981  *
15982  * if not have_step:
15983  * step = 1 # <<<<<<<<<<<<<<
15984  *
15985  *
15986  */
15987  __pyx_v_step = 1;
15988 
15989  /* "View.MemoryView":870
15990  * stop = shape
15991  *
15992  * if not have_step: # <<<<<<<<<<<<<<
15993  * step = 1
15994  *
15995  */
15996  }
15997 
15998  /* "View.MemoryView":875
15999  *
16000  * with cython.cdivision(True):
16001  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
16002  *
16003  * if (stop - start) - step * new_shape:
16004  */
16005  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16006 
16007  /* "View.MemoryView":877
16008  * new_shape = (stop - start) // step
16009  *
16010  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16011  * new_shape += 1
16012  *
16013  */
16014  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16015  if (__pyx_t_2) {
16016 
16017  /* "View.MemoryView":878
16018  *
16019  * if (stop - start) - step * new_shape:
16020  * new_shape += 1 # <<<<<<<<<<<<<<
16021  *
16022  * if new_shape < 0:
16023  */
16024  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16025 
16026  /* "View.MemoryView":877
16027  * new_shape = (stop - start) // step
16028  *
16029  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16030  * new_shape += 1
16031  *
16032  */
16033  }
16034 
16035  /* "View.MemoryView":880
16036  * new_shape += 1
16037  *
16038  * if new_shape < 0: # <<<<<<<<<<<<<<
16039  * new_shape = 0
16040  *
16041  */
16042  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16043  if (__pyx_t_2) {
16044 
16045  /* "View.MemoryView":881
16046  *
16047  * if new_shape < 0:
16048  * new_shape = 0 # <<<<<<<<<<<<<<
16049  *
16050  *
16051  */
16052  __pyx_v_new_shape = 0;
16053 
16054  /* "View.MemoryView":880
16055  * new_shape += 1
16056  *
16057  * if new_shape < 0: # <<<<<<<<<<<<<<
16058  * new_shape = 0
16059  *
16060  */
16061  }
16062 
16063  /* "View.MemoryView":884
16064  *
16065  *
16066  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
16067  * dst.shape[new_ndim] = new_shape
16068  * dst.suboffsets[new_ndim] = suboffset
16069  */
16070  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16071 
16072  /* "View.MemoryView":885
16073  *
16074  * dst.strides[new_ndim] = stride * step
16075  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
16076  * dst.suboffsets[new_ndim] = suboffset
16077  *
16078  */
16079  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16080 
16081  /* "View.MemoryView":886
16082  * dst.strides[new_ndim] = stride * step
16083  * dst.shape[new_ndim] = new_shape
16084  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
16085  *
16086  *
16087  */
16088  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16089  }
16090  __pyx_L3:;
16091 
16092  /* "View.MemoryView":889
16093  *
16094  *
16095  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16096  * dst.data += start * stride
16097  * else:
16098  */
16099  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16100  if (__pyx_t_2) {
16101 
16102  /* "View.MemoryView":890
16103  *
16104  * if suboffset_dim[0] < 0:
16105  * dst.data += start * stride # <<<<<<<<<<<<<<
16106  * else:
16107  * dst.suboffsets[suboffset_dim[0]] += start * stride
16108  */
16109  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16110 
16111  /* "View.MemoryView":889
16112  *
16113  *
16114  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16115  * dst.data += start * stride
16116  * else:
16117  */
16118  goto __pyx_L23;
16119  }
16120 
16121  /* "View.MemoryView":892
16122  * dst.data += start * stride
16123  * else:
16124  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
16125  *
16126  * if suboffset >= 0:
16127  */
16128  /*else*/ {
16129  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16130  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16131  }
16132  __pyx_L23:;
16133 
16134  /* "View.MemoryView":894
16135  * dst.suboffsets[suboffset_dim[0]] += start * stride
16136  *
16137  * if suboffset >= 0: # <<<<<<<<<<<<<<
16138  * if not is_slice:
16139  * if new_ndim == 0:
16140  */
16141  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16142  if (__pyx_t_2) {
16143 
16144  /* "View.MemoryView":895
16145  *
16146  * if suboffset >= 0:
16147  * if not is_slice: # <<<<<<<<<<<<<<
16148  * if new_ndim == 0:
16149  * dst.data = (<char **> dst.data)[0] + suboffset
16150  */
16151  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16152  if (__pyx_t_2) {
16153 
16154  /* "View.MemoryView":896
16155  * if suboffset >= 0:
16156  * if not is_slice:
16157  * if new_ndim == 0: # <<<<<<<<<<<<<<
16158  * dst.data = (<char **> dst.data)[0] + suboffset
16159  * else:
16160  */
16161  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16162  if (__pyx_t_2) {
16163 
16164  /* "View.MemoryView":897
16165  * if not is_slice:
16166  * if new_ndim == 0:
16167  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
16168  * else:
16169  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16170  */
16171  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16172 
16173  /* "View.MemoryView":896
16174  * if suboffset >= 0:
16175  * if not is_slice:
16176  * if new_ndim == 0: # <<<<<<<<<<<<<<
16177  * dst.data = (<char **> dst.data)[0] + suboffset
16178  * else:
16179  */
16180  goto __pyx_L26;
16181  }
16182 
16183  /* "View.MemoryView":899
16184  * dst.data = (<char **> dst.data)[0] + suboffset
16185  * else:
16186  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
16187  * "must be indexed and not sliced", dim)
16188  * else:
16189  */
16190  /*else*/ {
16191 
16192  /* "View.MemoryView":900
16193  * else:
16194  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16195  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
16196  * else:
16197  * suboffset_dim[0] = new_ndim
16198  */
16199  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
16200  }
16201  __pyx_L26:;
16202 
16203  /* "View.MemoryView":895
16204  *
16205  * if suboffset >= 0:
16206  * if not is_slice: # <<<<<<<<<<<<<<
16207  * if new_ndim == 0:
16208  * dst.data = (<char **> dst.data)[0] + suboffset
16209  */
16210  goto __pyx_L25;
16211  }
16212 
16213  /* "View.MemoryView":902
16214  * "must be indexed and not sliced", dim)
16215  * else:
16216  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
16217  *
16218  * return 0
16219  */
16220  /*else*/ {
16221  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16222  }
16223  __pyx_L25:;
16224 
16225  /* "View.MemoryView":894
16226  * dst.suboffsets[suboffset_dim[0]] += start * stride
16227  *
16228  * if suboffset >= 0: # <<<<<<<<<<<<<<
16229  * if not is_slice:
16230  * if new_ndim == 0:
16231  */
16232  }
16233 
16234  /* "View.MemoryView":904
16235  * suboffset_dim[0] = new_ndim
16236  *
16237  * return 0 # <<<<<<<<<<<<<<
16238  *
16239  *
16240  */
16241  __pyx_r = 0;
16242  goto __pyx_L0;
16243 
16244  /* "View.MemoryView":807
16245  *
16246  * @cname('__pyx_memoryview_slice_memviewslice')
16247  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16248  * __Pyx_memviewslice *dst,
16249  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16250  */
16251 
16252  /* function exit code */
16253  __pyx_L1_error:;
16254  {
16255  #ifdef WITH_THREAD
16256  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16257  #endif
16258  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16259  #ifdef WITH_THREAD
16260  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16261  #endif
16262  }
16263  __pyx_r = -1;
16264  __pyx_L0:;
16265  return __pyx_r;
16266 }
16267 
16268 /* "View.MemoryView":910
16269  *
16270  * @cname('__pyx_pybuffer_index')
16271  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16272  * Py_ssize_t dim) except NULL:
16273  * cdef Py_ssize_t shape, stride, suboffset = -1
16274  */
16275 
16276 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
16277  Py_ssize_t __pyx_v_shape;
16278  Py_ssize_t __pyx_v_stride;
16279  Py_ssize_t __pyx_v_suboffset;
16280  Py_ssize_t __pyx_v_itemsize;
16281  char *__pyx_v_resultp;
16282  char *__pyx_r;
16283  __Pyx_RefNannyDeclarations
16284  Py_ssize_t __pyx_t_1;
16285  int __pyx_t_2;
16286  PyObject *__pyx_t_3 = NULL;
16287  PyObject *__pyx_t_4 = NULL;
16288  int __pyx_lineno = 0;
16289  const char *__pyx_filename = NULL;
16290  int __pyx_clineno = 0;
16291  __Pyx_RefNannySetupContext("pybuffer_index", 0);
16292 
16293  /* "View.MemoryView":912
16294  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
16295  * Py_ssize_t dim) except NULL:
16296  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
16297  * cdef Py_ssize_t itemsize = view.itemsize
16298  * cdef char *resultp
16299  */
16300  __pyx_v_suboffset = -1L;
16301 
16302  /* "View.MemoryView":913
16303  * Py_ssize_t dim) except NULL:
16304  * cdef Py_ssize_t shape, stride, suboffset = -1
16305  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
16306  * cdef char *resultp
16307  *
16308  */
16309  __pyx_t_1 = __pyx_v_view->itemsize;
16310  __pyx_v_itemsize = __pyx_t_1;
16311 
16312  /* "View.MemoryView":916
16313  * cdef char *resultp
16314  *
16315  * if view.ndim == 0: # <<<<<<<<<<<<<<
16316  * shape = view.len / itemsize
16317  * stride = itemsize
16318  */
16319  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16320  if (__pyx_t_2) {
16321 
16322  /* "View.MemoryView":917
16323  *
16324  * if view.ndim == 0:
16325  * shape = view.len / itemsize # <<<<<<<<<<<<<<
16326  * stride = itemsize
16327  * else:
16328  */
16329  if (unlikely(__pyx_v_itemsize == 0)) {
16330  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
16331  __PYX_ERR(1, 917, __pyx_L1_error)
16332  }
16333  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
16334  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
16335  __PYX_ERR(1, 917, __pyx_L1_error)
16336  }
16337  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
16338 
16339  /* "View.MemoryView":918
16340  * if view.ndim == 0:
16341  * shape = view.len / itemsize
16342  * stride = itemsize # <<<<<<<<<<<<<<
16343  * else:
16344  * shape = view.shape[dim]
16345  */
16346  __pyx_v_stride = __pyx_v_itemsize;
16347 
16348  /* "View.MemoryView":916
16349  * cdef char *resultp
16350  *
16351  * if view.ndim == 0: # <<<<<<<<<<<<<<
16352  * shape = view.len / itemsize
16353  * stride = itemsize
16354  */
16355  goto __pyx_L3;
16356  }
16357 
16358  /* "View.MemoryView":920
16359  * stride = itemsize
16360  * else:
16361  * shape = view.shape[dim] # <<<<<<<<<<<<<<
16362  * stride = view.strides[dim]
16363  * if view.suboffsets != NULL:
16364  */
16365  /*else*/ {
16366  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16367 
16368  /* "View.MemoryView":921
16369  * else:
16370  * shape = view.shape[dim]
16371  * stride = view.strides[dim] # <<<<<<<<<<<<<<
16372  * if view.suboffsets != NULL:
16373  * suboffset = view.suboffsets[dim]
16374  */
16375  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16376 
16377  /* "View.MemoryView":922
16378  * shape = view.shape[dim]
16379  * stride = view.strides[dim]
16380  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16381  * suboffset = view.suboffsets[dim]
16382  *
16383  */
16384  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16385  if (__pyx_t_2) {
16386 
16387  /* "View.MemoryView":923
16388  * stride = view.strides[dim]
16389  * if view.suboffsets != NULL:
16390  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
16391  *
16392  * if index < 0:
16393  */
16394  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16395 
16396  /* "View.MemoryView":922
16397  * shape = view.shape[dim]
16398  * stride = view.strides[dim]
16399  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16400  * suboffset = view.suboffsets[dim]
16401  *
16402  */
16403  }
16404  }
16405  __pyx_L3:;
16406 
16407  /* "View.MemoryView":925
16408  * suboffset = view.suboffsets[dim]
16409  *
16410  * if index < 0: # <<<<<<<<<<<<<<
16411  * index += view.shape[dim]
16412  * if index < 0:
16413  */
16414  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16415  if (__pyx_t_2) {
16416 
16417  /* "View.MemoryView":926
16418  *
16419  * if index < 0:
16420  * index += view.shape[dim] # <<<<<<<<<<<<<<
16421  * if index < 0:
16422  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16423  */
16424  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
16425 
16426  /* "View.MemoryView":927
16427  * if index < 0:
16428  * index += view.shape[dim]
16429  * if index < 0: # <<<<<<<<<<<<<<
16430  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16431  *
16432  */
16433  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16434  if (unlikely(__pyx_t_2)) {
16435 
16436  /* "View.MemoryView":928
16437  * index += view.shape[dim]
16438  * if index < 0:
16439  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16440  *
16441  * if index >= shape:
16442  */
16443  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
16444  __Pyx_GOTREF(__pyx_t_3);
16445  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
16446  __Pyx_GOTREF(__pyx_t_4);
16447  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16448  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
16449  __Pyx_GOTREF(__pyx_t_3);
16450  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16451  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16452  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16453  __PYX_ERR(1, 928, __pyx_L1_error)
16454 
16455  /* "View.MemoryView":927
16456  * if index < 0:
16457  * index += view.shape[dim]
16458  * if index < 0: # <<<<<<<<<<<<<<
16459  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16460  *
16461  */
16462  }
16463 
16464  /* "View.MemoryView":925
16465  * suboffset = view.suboffsets[dim]
16466  *
16467  * if index < 0: # <<<<<<<<<<<<<<
16468  * index += view.shape[dim]
16469  * if index < 0:
16470  */
16471  }
16472 
16473  /* "View.MemoryView":930
16474  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16475  *
16476  * if index >= shape: # <<<<<<<<<<<<<<
16477  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16478  *
16479  */
16480  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
16481  if (unlikely(__pyx_t_2)) {
16482 
16483  /* "View.MemoryView":931
16484  *
16485  * if index >= shape:
16486  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16487  *
16488  * resultp = bufp + index * stride
16489  */
16490  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
16491  __Pyx_GOTREF(__pyx_t_3);
16492  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
16493  __Pyx_GOTREF(__pyx_t_4);
16494  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16495  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
16496  __Pyx_GOTREF(__pyx_t_3);
16497  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16498  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16499  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16500  __PYX_ERR(1, 931, __pyx_L1_error)
16501 
16502  /* "View.MemoryView":930
16503  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16504  *
16505  * if index >= shape: # <<<<<<<<<<<<<<
16506  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16507  *
16508  */
16509  }
16510 
16511  /* "View.MemoryView":933
16512  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16513  *
16514  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
16515  * if suboffset >= 0:
16516  * resultp = (<char **> resultp)[0] + suboffset
16517  */
16518  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
16519 
16520  /* "View.MemoryView":934
16521  *
16522  * resultp = bufp + index * stride
16523  * if suboffset >= 0: # <<<<<<<<<<<<<<
16524  * resultp = (<char **> resultp)[0] + suboffset
16525  *
16526  */
16527  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16528  if (__pyx_t_2) {
16529 
16530  /* "View.MemoryView":935
16531  * resultp = bufp + index * stride
16532  * if suboffset >= 0:
16533  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
16534  *
16535  * return resultp
16536  */
16537  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
16538 
16539  /* "View.MemoryView":934
16540  *
16541  * resultp = bufp + index * stride
16542  * if suboffset >= 0: # <<<<<<<<<<<<<<
16543  * resultp = (<char **> resultp)[0] + suboffset
16544  *
16545  */
16546  }
16547 
16548  /* "View.MemoryView":937
16549  * resultp = (<char **> resultp)[0] + suboffset
16550  *
16551  * return resultp # <<<<<<<<<<<<<<
16552  *
16553  *
16554  */
16555  __pyx_r = __pyx_v_resultp;
16556  goto __pyx_L0;
16557 
16558  /* "View.MemoryView":910
16559  *
16560  * @cname('__pyx_pybuffer_index')
16561  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16562  * Py_ssize_t dim) except NULL:
16563  * cdef Py_ssize_t shape, stride, suboffset = -1
16564  */
16565 
16566  /* function exit code */
16567  __pyx_L1_error:;
16568  __Pyx_XDECREF(__pyx_t_3);
16569  __Pyx_XDECREF(__pyx_t_4);
16570  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
16571  __pyx_r = NULL;
16572  __pyx_L0:;
16573  __Pyx_RefNannyFinishContext();
16574  return __pyx_r;
16575 }
16576 
16577 /* "View.MemoryView":943
16578  *
16579  * @cname('__pyx_memslice_transpose')
16580  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
16581  * cdef int ndim = memslice.memview.view.ndim
16582  *
16583  */
16584 
16585 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
16586  int __pyx_v_ndim;
16587  Py_ssize_t *__pyx_v_shape;
16588  Py_ssize_t *__pyx_v_strides;
16589  int __pyx_v_i;
16590  int __pyx_v_j;
16591  int __pyx_r;
16592  int __pyx_t_1;
16593  Py_ssize_t *__pyx_t_2;
16594  long __pyx_t_3;
16595  long __pyx_t_4;
16596  Py_ssize_t __pyx_t_5;
16597  Py_ssize_t __pyx_t_6;
16598  int __pyx_t_7;
16599  int __pyx_t_8;
16600  int __pyx_t_9;
16601  int __pyx_lineno = 0;
16602  const char *__pyx_filename = NULL;
16603  int __pyx_clineno = 0;
16604 
16605  /* "View.MemoryView":944
16606  * @cname('__pyx_memslice_transpose')
16607  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
16608  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
16609  *
16610  * cdef Py_ssize_t *shape = memslice.shape
16611  */
16612  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
16613  __pyx_v_ndim = __pyx_t_1;
16614 
16615  /* "View.MemoryView":946
16616  * cdef int ndim = memslice.memview.view.ndim
16617  *
16618  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
16619  * cdef Py_ssize_t *strides = memslice.strides
16620  *
16621  */
16622  __pyx_t_2 = __pyx_v_memslice->shape;
16623  __pyx_v_shape = __pyx_t_2;
16624 
16625  /* "View.MemoryView":947
16626  *
16627  * cdef Py_ssize_t *shape = memslice.shape
16628  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
16629  *
16630  *
16631  */
16632  __pyx_t_2 = __pyx_v_memslice->strides;
16633  __pyx_v_strides = __pyx_t_2;
16634 
16635  /* "View.MemoryView":951
16636  *
16637  * cdef int i, j
16638  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
16639  * j = ndim - 1 - i
16640  * strides[i], strides[j] = strides[j], strides[i]
16641  */
16642  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
16643  __pyx_t_4 = __pyx_t_3;
16644  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
16645  __pyx_v_i = __pyx_t_1;
16646 
16647  /* "View.MemoryView":952
16648  * cdef int i, j
16649  * for i in range(ndim / 2):
16650  * j = ndim - 1 - i # <<<<<<<<<<<<<<
16651  * strides[i], strides[j] = strides[j], strides[i]
16652  * shape[i], shape[j] = shape[j], shape[i]
16653  */
16654  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
16655 
16656  /* "View.MemoryView":953
16657  * for i in range(ndim / 2):
16658  * j = ndim - 1 - i
16659  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
16660  * shape[i], shape[j] = shape[j], shape[i]
16661  *
16662  */
16663  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
16664  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
16665  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
16666  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
16667 
16668  /* "View.MemoryView":954
16669  * j = ndim - 1 - i
16670  * strides[i], strides[j] = strides[j], strides[i]
16671  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
16672  *
16673  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
16674  */
16675  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
16676  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
16677  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
16678  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
16679 
16680  /* "View.MemoryView":956
16681  * shape[i], shape[j] = shape[j], shape[i]
16682  *
16683  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
16684  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16685  *
16686  */
16687  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
16688  if (!__pyx_t_8) {
16689  } else {
16690  __pyx_t_7 = __pyx_t_8;
16691  goto __pyx_L6_bool_binop_done;
16692  }
16693  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
16694  __pyx_t_7 = __pyx_t_8;
16695  __pyx_L6_bool_binop_done:;
16696  if (__pyx_t_7) {
16697 
16698  /* "View.MemoryView":957
16699  *
16700  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
16701  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
16702  *
16703  * return 1
16704  */
16705  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
16706 
16707  /* "View.MemoryView":956
16708  * shape[i], shape[j] = shape[j], shape[i]
16709  *
16710  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
16711  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16712  *
16713  */
16714  }
16715  }
16716 
16717  /* "View.MemoryView":959
16718  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16719  *
16720  * return 1 # <<<<<<<<<<<<<<
16721  *
16722  *
16723  */
16724  __pyx_r = 1;
16725  goto __pyx_L0;
16726 
16727  /* "View.MemoryView":943
16728  *
16729  * @cname('__pyx_memslice_transpose')
16730  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
16731  * cdef int ndim = memslice.memview.view.ndim
16732  *
16733  */
16734 
16735  /* function exit code */
16736  __pyx_L1_error:;
16737  {
16738  #ifdef WITH_THREAD
16739  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16740  #endif
16741  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16742  #ifdef WITH_THREAD
16743  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16744  #endif
16745  }
16746  __pyx_r = 0;
16747  __pyx_L0:;
16748  return __pyx_r;
16749 }
16750 
16751 /* "View.MemoryView":976
16752  * cdef int (*to_dtype_func)(char *, object) except 0
16753  *
16754  * def __dealloc__(self): # <<<<<<<<<<<<<<
16755  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16756  *
16757  */
16758 
16759 /* Python wrapper */
16760 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
16761 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
16762  __Pyx_RefNannyDeclarations
16763  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
16764  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16765 
16766  /* function exit code */
16767  __Pyx_RefNannyFinishContext();
16768 }
16769 
16770 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16771  __Pyx_RefNannyDeclarations
16772  __Pyx_RefNannySetupContext("__dealloc__", 0);
16773 
16774  /* "View.MemoryView":977
16775  *
16776  * def __dealloc__(self):
16777  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
16778  *
16779  * cdef convert_item_to_object(self, char *itemp):
16780  */
16781  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
16782 
16783  /* "View.MemoryView":976
16784  * cdef int (*to_dtype_func)(char *, object) except 0
16785  *
16786  * def __dealloc__(self): # <<<<<<<<<<<<<<
16787  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16788  *
16789  */
16790 
16791  /* function exit code */
16792  __Pyx_RefNannyFinishContext();
16793 }
16794 
16795 /* "View.MemoryView":979
16796  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16797  *
16798  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
16799  * if self.to_object_func != NULL:
16800  * return self.to_object_func(itemp)
16801  */
16802 
16803 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
16804  PyObject *__pyx_r = NULL;
16805  __Pyx_RefNannyDeclarations
16806  int __pyx_t_1;
16807  PyObject *__pyx_t_2 = NULL;
16808  int __pyx_lineno = 0;
16809  const char *__pyx_filename = NULL;
16810  int __pyx_clineno = 0;
16811  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
16812 
16813  /* "View.MemoryView":980
16814  *
16815  * cdef convert_item_to_object(self, char *itemp):
16816  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
16817  * return self.to_object_func(itemp)
16818  * else:
16819  */
16820  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
16821  if (__pyx_t_1) {
16822 
16823  /* "View.MemoryView":981
16824  * cdef convert_item_to_object(self, char *itemp):
16825  * if self.to_object_func != NULL:
16826  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
16827  * else:
16828  * return memoryview.convert_item_to_object(self, itemp)
16829  */
16830  __Pyx_XDECREF(__pyx_r);
16831  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
16832  __Pyx_GOTREF(__pyx_t_2);
16833  __pyx_r = __pyx_t_2;
16834  __pyx_t_2 = 0;
16835  goto __pyx_L0;
16836 
16837  /* "View.MemoryView":980
16838  *
16839  * cdef convert_item_to_object(self, char *itemp):
16840  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
16841  * return self.to_object_func(itemp)
16842  * else:
16843  */
16844  }
16845 
16846  /* "View.MemoryView":983
16847  * return self.to_object_func(itemp)
16848  * else:
16849  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
16850  *
16851  * cdef assign_item_from_object(self, char *itemp, object value):
16852  */
16853  /*else*/ {
16854  __Pyx_XDECREF(__pyx_r);
16855  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
16856  __Pyx_GOTREF(__pyx_t_2);
16857  __pyx_r = __pyx_t_2;
16858  __pyx_t_2 = 0;
16859  goto __pyx_L0;
16860  }
16861 
16862  /* "View.MemoryView":979
16863  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16864  *
16865  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
16866  * if self.to_object_func != NULL:
16867  * return self.to_object_func(itemp)
16868  */
16869 
16870  /* function exit code */
16871  __pyx_L1_error:;
16872  __Pyx_XDECREF(__pyx_t_2);
16873  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16874  __pyx_r = 0;
16875  __pyx_L0:;
16876  __Pyx_XGIVEREF(__pyx_r);
16877  __Pyx_RefNannyFinishContext();
16878  return __pyx_r;
16879 }
16880 
16881 /* "View.MemoryView":985
16882  * return memoryview.convert_item_to_object(self, itemp)
16883  *
16884  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
16885  * if self.to_dtype_func != NULL:
16886  * self.to_dtype_func(itemp, value)
16887  */
16888 
16889 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
16890  PyObject *__pyx_r = NULL;
16891  __Pyx_RefNannyDeclarations
16892  int __pyx_t_1;
16893  int __pyx_t_2;
16894  PyObject *__pyx_t_3 = NULL;
16895  int __pyx_lineno = 0;
16896  const char *__pyx_filename = NULL;
16897  int __pyx_clineno = 0;
16898  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
16899 
16900  /* "View.MemoryView":986
16901  *
16902  * cdef assign_item_from_object(self, char *itemp, object value):
16903  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
16904  * self.to_dtype_func(itemp, value)
16905  * else:
16906  */
16907  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
16908  if (__pyx_t_1) {
16909 
16910  /* "View.MemoryView":987
16911  * cdef assign_item_from_object(self, char *itemp, object value):
16912  * if self.to_dtype_func != NULL:
16913  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
16914  * else:
16915  * memoryview.assign_item_from_object(self, itemp, value)
16916  */
16917  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
16918 
16919  /* "View.MemoryView":986
16920  *
16921  * cdef assign_item_from_object(self, char *itemp, object value):
16922  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
16923  * self.to_dtype_func(itemp, value)
16924  * else:
16925  */
16926  goto __pyx_L3;
16927  }
16928 
16929  /* "View.MemoryView":989
16930  * self.to_dtype_func(itemp, value)
16931  * else:
16932  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
16933  *
16934  * @property
16935  */
16936  /*else*/ {
16937  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
16938  __Pyx_GOTREF(__pyx_t_3);
16939  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16940  }
16941  __pyx_L3:;
16942 
16943  /* "View.MemoryView":985
16944  * return memoryview.convert_item_to_object(self, itemp)
16945  *
16946  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
16947  * if self.to_dtype_func != NULL:
16948  * self.to_dtype_func(itemp, value)
16949  */
16950 
16951  /* function exit code */
16952  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16953  goto __pyx_L0;
16954  __pyx_L1_error:;
16955  __Pyx_XDECREF(__pyx_t_3);
16956  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16957  __pyx_r = 0;
16958  __pyx_L0:;
16959  __Pyx_XGIVEREF(__pyx_r);
16960  __Pyx_RefNannyFinishContext();
16961  return __pyx_r;
16962 }
16963 
16964 /* "View.MemoryView":992
16965  *
16966  * @property
16967  * def base(self): # <<<<<<<<<<<<<<
16968  * return self.from_object
16969  *
16970  */
16971 
16972 /* Python wrapper */
16973 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
16974 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
16975  PyObject *__pyx_r = 0;
16976  __Pyx_RefNannyDeclarations
16977  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16978  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16979 
16980  /* function exit code */
16981  __Pyx_RefNannyFinishContext();
16982  return __pyx_r;
16983 }
16984 
16985 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16986  PyObject *__pyx_r = NULL;
16987  __Pyx_RefNannyDeclarations
16988  __Pyx_RefNannySetupContext("__get__", 0);
16989 
16990  /* "View.MemoryView":993
16991  * @property
16992  * def base(self):
16993  * return self.from_object # <<<<<<<<<<<<<<
16994  *
16995  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
16996  */
16997  __Pyx_XDECREF(__pyx_r);
16998  __Pyx_INCREF(__pyx_v_self->from_object);
16999  __pyx_r = __pyx_v_self->from_object;
17000  goto __pyx_L0;
17001 
17002  /* "View.MemoryView":992
17003  *
17004  * @property
17005  * def base(self): # <<<<<<<<<<<<<<
17006  * return self.from_object
17007  *
17008  */
17009 
17010  /* function exit code */
17011  __pyx_L0:;
17012  __Pyx_XGIVEREF(__pyx_r);
17013  __Pyx_RefNannyFinishContext();
17014  return __pyx_r;
17015 }
17016 
17017 /* "(tree fragment)":1
17018  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17019  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17020  * def __setstate_cython__(self, __pyx_state):
17021  */
17022 
17023 /* Python wrapper */
17024 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
17025 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17026  PyObject *__pyx_r = 0;
17027  __Pyx_RefNannyDeclarations
17028  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
17029  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17030 
17031  /* function exit code */
17032  __Pyx_RefNannyFinishContext();
17033  return __pyx_r;
17034 }
17035 
17036 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17037  PyObject *__pyx_r = NULL;
17038  __Pyx_RefNannyDeclarations
17039  PyObject *__pyx_t_1 = NULL;
17040  int __pyx_lineno = 0;
17041  const char *__pyx_filename = NULL;
17042  int __pyx_clineno = 0;
17043  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
17044 
17045  /* "(tree fragment)":2
17046  * def __reduce_cython__(self):
17047  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17048  * def __setstate_cython__(self, __pyx_state):
17049  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17050  */
17051  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
17052  __Pyx_GOTREF(__pyx_t_1);
17053  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17054  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17055  __PYX_ERR(1, 2, __pyx_L1_error)
17056 
17057  /* "(tree fragment)":1
17058  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17059  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17060  * def __setstate_cython__(self, __pyx_state):
17061  */
17062 
17063  /* function exit code */
17064  __pyx_L1_error:;
17065  __Pyx_XDECREF(__pyx_t_1);
17066  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17067  __pyx_r = NULL;
17068  __Pyx_XGIVEREF(__pyx_r);
17069  __Pyx_RefNannyFinishContext();
17070  return __pyx_r;
17071 }
17072 
17073 /* "(tree fragment)":3
17074  * def __reduce_cython__(self):
17075  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17076  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17077  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17078  */
17079 
17080 /* Python wrapper */
17081 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
17082 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17083  PyObject *__pyx_r = 0;
17084  __Pyx_RefNannyDeclarations
17085  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
17086  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17087 
17088  /* function exit code */
17089  __Pyx_RefNannyFinishContext();
17090  return __pyx_r;
17091 }
17092 
17093 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
17094  PyObject *__pyx_r = NULL;
17095  __Pyx_RefNannyDeclarations
17096  PyObject *__pyx_t_1 = NULL;
17097  int __pyx_lineno = 0;
17098  const char *__pyx_filename = NULL;
17099  int __pyx_clineno = 0;
17100  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
17101 
17102  /* "(tree fragment)":4
17103  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17104  * def __setstate_cython__(self, __pyx_state):
17105  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17106  */
17107  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
17108  __Pyx_GOTREF(__pyx_t_1);
17109  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17110  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17111  __PYX_ERR(1, 4, __pyx_L1_error)
17112 
17113  /* "(tree fragment)":3
17114  * def __reduce_cython__(self):
17115  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17116  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17117  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17118  */
17119 
17120  /* function exit code */
17121  __pyx_L1_error:;
17122  __Pyx_XDECREF(__pyx_t_1);
17123  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17124  __pyx_r = NULL;
17125  __Pyx_XGIVEREF(__pyx_r);
17126  __Pyx_RefNannyFinishContext();
17127  return __pyx_r;
17128 }
17129 
17130 /* "View.MemoryView":999
17131  *
17132  * @cname('__pyx_memoryview_fromslice')
17133  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17134  * int ndim,
17135  * object (*to_object_func)(char *),
17136  */
17137 
17138 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
17139  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17140  Py_ssize_t __pyx_v_suboffset;
17141  PyObject *__pyx_v_length = NULL;
17142  PyObject *__pyx_r = NULL;
17143  __Pyx_RefNannyDeclarations
17144  int __pyx_t_1;
17145  PyObject *__pyx_t_2 = NULL;
17146  PyObject *__pyx_t_3 = NULL;
17147  __Pyx_TypeInfo *__pyx_t_4;
17148  Py_buffer __pyx_t_5;
17149  Py_ssize_t *__pyx_t_6;
17150  Py_ssize_t *__pyx_t_7;
17151  Py_ssize_t *__pyx_t_8;
17152  Py_ssize_t __pyx_t_9;
17153  int __pyx_lineno = 0;
17154  const char *__pyx_filename = NULL;
17155  int __pyx_clineno = 0;
17156  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
17157 
17158  /* "View.MemoryView":1007
17159  * cdef _memoryviewslice result
17160  *
17161  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17162  * return None
17163  *
17164  */
17165  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17166  if (__pyx_t_1) {
17167 
17168  /* "View.MemoryView":1008
17169  *
17170  * if <PyObject *> memviewslice.memview == Py_None:
17171  * return None # <<<<<<<<<<<<<<
17172  *
17173  *
17174  */
17175  __Pyx_XDECREF(__pyx_r);
17176  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17177  goto __pyx_L0;
17178 
17179  /* "View.MemoryView":1007
17180  * cdef _memoryviewslice result
17181  *
17182  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17183  * return None
17184  *
17185  */
17186  }
17187 
17188  /* "View.MemoryView":1013
17189  *
17190  *
17191  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
17192  *
17193  * result.from_slice = memviewslice
17194  */
17195  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17196  __Pyx_GOTREF(__pyx_t_2);
17197  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
17198  __Pyx_GOTREF(__pyx_t_3);
17199  __Pyx_INCREF(Py_None);
17200  __Pyx_GIVEREF(Py_None);
17201  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17202  __Pyx_INCREF(__pyx_int_0);
17203  __Pyx_GIVEREF(__pyx_int_0);
17204  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17205  __Pyx_GIVEREF(__pyx_t_2);
17206  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17207  __pyx_t_2 = 0;
17208  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17209  __Pyx_GOTREF(__pyx_t_2);
17210  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17211  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17212  __pyx_t_2 = 0;
17213 
17214  /* "View.MemoryView":1015
17215  * result = _memoryviewslice(None, 0, dtype_is_object)
17216  *
17217  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
17218  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17219  *
17220  */
17221  __pyx_v_result->from_slice = __pyx_v_memviewslice;
17222 
17223  /* "View.MemoryView":1016
17224  *
17225  * result.from_slice = memviewslice
17226  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
17227  *
17228  * result.from_object = (<memoryview> memviewslice.memview).base
17229  */
17230  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17231 
17232  /* "View.MemoryView":1018
17233  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17234  *
17235  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
17236  * result.typeinfo = memviewslice.memview.typeinfo
17237  *
17238  */
17239  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
17240  __Pyx_GOTREF(__pyx_t_2);
17241  __Pyx_GIVEREF(__pyx_t_2);
17242  __Pyx_GOTREF(__pyx_v_result->from_object);
17243  __Pyx_DECREF(__pyx_v_result->from_object);
17244  __pyx_v_result->from_object = __pyx_t_2;
17245  __pyx_t_2 = 0;
17246 
17247  /* "View.MemoryView":1019
17248  *
17249  * result.from_object = (<memoryview> memviewslice.memview).base
17250  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
17251  *
17252  * result.view = memviewslice.memview.view
17253  */
17254  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17255  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17256 
17257  /* "View.MemoryView":1021
17258  * result.typeinfo = memviewslice.memview.typeinfo
17259  *
17260  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
17261  * result.view.buf = <void *> memviewslice.data
17262  * result.view.ndim = ndim
17263  */
17264  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17265  __pyx_v_result->__pyx_base.view = __pyx_t_5;
17266 
17267  /* "View.MemoryView":1022
17268  *
17269  * result.view = memviewslice.memview.view
17270  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
17271  * result.view.ndim = ndim
17272  * (<__pyx_buffer *> &result.view).obj = Py_None
17273  */
17274  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
17275 
17276  /* "View.MemoryView":1023
17277  * result.view = memviewslice.memview.view
17278  * result.view.buf = <void *> memviewslice.data
17279  * result.view.ndim = ndim # <<<<<<<<<<<<<<
17280  * (<__pyx_buffer *> &result.view).obj = Py_None
17281  * Py_INCREF(Py_None)
17282  */
17283  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17284 
17285  /* "View.MemoryView":1024
17286  * result.view.buf = <void *> memviewslice.data
17287  * result.view.ndim = ndim
17288  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
17289  * Py_INCREF(Py_None)
17290  *
17291  */
17292  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17293 
17294  /* "View.MemoryView":1025
17295  * result.view.ndim = ndim
17296  * (<__pyx_buffer *> &result.view).obj = Py_None
17297  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
17298  *
17299  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17300  */
17301  Py_INCREF(Py_None);
17302 
17303  /* "View.MemoryView":1027
17304  * Py_INCREF(Py_None)
17305  *
17306  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17307  * result.flags = PyBUF_RECORDS
17308  * else:
17309  */
17310  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17311  if (__pyx_t_1) {
17312 
17313  /* "View.MemoryView":1028
17314  *
17315  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17316  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
17317  * else:
17318  * result.flags = PyBUF_RECORDS_RO
17319  */
17320  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17321 
17322  /* "View.MemoryView":1027
17323  * Py_INCREF(Py_None)
17324  *
17325  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17326  * result.flags = PyBUF_RECORDS
17327  * else:
17328  */
17329  goto __pyx_L4;
17330  }
17331 
17332  /* "View.MemoryView":1030
17333  * result.flags = PyBUF_RECORDS
17334  * else:
17335  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
17336  *
17337  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17338  */
17339  /*else*/ {
17340  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17341  }
17342  __pyx_L4:;
17343 
17344  /* "View.MemoryView":1032
17345  * result.flags = PyBUF_RECORDS_RO
17346  *
17347  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
17348  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
17349  *
17350  */
17351  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17352 
17353  /* "View.MemoryView":1033
17354  *
17355  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17356  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
17357  *
17358  *
17359  */
17360  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17361 
17362  /* "View.MemoryView":1036
17363  *
17364  *
17365  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
17366  * for suboffset in result.from_slice.suboffsets[:ndim]:
17367  * if suboffset >= 0:
17368  */
17369  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17370 
17371  /* "View.MemoryView":1037
17372  *
17373  * result.view.suboffsets = NULL
17374  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
17375  * if suboffset >= 0:
17376  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17377  */
17378  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17379  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17380  __pyx_t_6 = __pyx_t_8;
17381  __pyx_v_suboffset = (__pyx_t_6[0]);
17382 
17383  /* "View.MemoryView":1038
17384  * result.view.suboffsets = NULL
17385  * for suboffset in result.from_slice.suboffsets[:ndim]:
17386  * if suboffset >= 0: # <<<<<<<<<<<<<<
17387  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17388  * break
17389  */
17390  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17391  if (__pyx_t_1) {
17392 
17393  /* "View.MemoryView":1039
17394  * for suboffset in result.from_slice.suboffsets[:ndim]:
17395  * if suboffset >= 0:
17396  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
17397  * break
17398  *
17399  */
17400  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17401 
17402  /* "View.MemoryView":1040
17403  * if suboffset >= 0:
17404  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17405  * break # <<<<<<<<<<<<<<
17406  *
17407  * result.view.len = result.view.itemsize
17408  */
17409  goto __pyx_L6_break;
17410 
17411  /* "View.MemoryView":1038
17412  * result.view.suboffsets = NULL
17413  * for suboffset in result.from_slice.suboffsets[:ndim]:
17414  * if suboffset >= 0: # <<<<<<<<<<<<<<
17415  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17416  * break
17417  */
17418  }
17419  }
17420  __pyx_L6_break:;
17421 
17422  /* "View.MemoryView":1042
17423  * break
17424  *
17425  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
17426  * for length in result.view.shape[:ndim]:
17427  * result.view.len *= length
17428  */
17429  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
17430  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17431 
17432  /* "View.MemoryView":1043
17433  *
17434  * result.view.len = result.view.itemsize
17435  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
17436  * result.view.len *= length
17437  *
17438  */
17439  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
17440  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17441  __pyx_t_6 = __pyx_t_8;
17442  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
17443  __Pyx_GOTREF(__pyx_t_2);
17444  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
17445  __pyx_t_2 = 0;
17446 
17447  /* "View.MemoryView":1044
17448  * result.view.len = result.view.itemsize
17449  * for length in result.view.shape[:ndim]:
17450  * result.view.len *= length # <<<<<<<<<<<<<<
17451  *
17452  * result.to_object_func = to_object_func
17453  */
17454  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
17455  __Pyx_GOTREF(__pyx_t_2);
17456  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
17457  __Pyx_GOTREF(__pyx_t_3);
17458  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17459  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
17460  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17461  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17462  }
17463 
17464  /* "View.MemoryView":1046
17465  * result.view.len *= length
17466  *
17467  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
17468  * result.to_dtype_func = to_dtype_func
17469  *
17470  */
17471  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
17472 
17473  /* "View.MemoryView":1047
17474  *
17475  * result.to_object_func = to_object_func
17476  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
17477  *
17478  * return result
17479  */
17480  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
17481 
17482  /* "View.MemoryView":1049
17483  * result.to_dtype_func = to_dtype_func
17484  *
17485  * return result # <<<<<<<<<<<<<<
17486  *
17487  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17488  */
17489  __Pyx_XDECREF(__pyx_r);
17490  __Pyx_INCREF(((PyObject *)__pyx_v_result));
17491  __pyx_r = ((PyObject *)__pyx_v_result);
17492  goto __pyx_L0;
17493 
17494  /* "View.MemoryView":999
17495  *
17496  * @cname('__pyx_memoryview_fromslice')
17497  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17498  * int ndim,
17499  * object (*to_object_func)(char *),
17500  */
17501 
17502  /* function exit code */
17503  __pyx_L1_error:;
17504  __Pyx_XDECREF(__pyx_t_2);
17505  __Pyx_XDECREF(__pyx_t_3);
17506  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17507  __pyx_r = 0;
17508  __pyx_L0:;
17509  __Pyx_XDECREF((PyObject *)__pyx_v_result);
17510  __Pyx_XDECREF(__pyx_v_length);
17511  __Pyx_XGIVEREF(__pyx_r);
17512  __Pyx_RefNannyFinishContext();
17513  return __pyx_r;
17514 }
17515 
17516 /* "View.MemoryView":1052
17517  *
17518  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17519  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
17520  * __Pyx_memviewslice *mslice) except NULL:
17521  * cdef _memoryviewslice obj
17522  */
17523 
17524 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
17525  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
17526  __Pyx_memviewslice *__pyx_r;
17527  __Pyx_RefNannyDeclarations
17528  int __pyx_t_1;
17529  int __pyx_t_2;
17530  PyObject *__pyx_t_3 = NULL;
17531  int __pyx_lineno = 0;
17532  const char *__pyx_filename = NULL;
17533  int __pyx_clineno = 0;
17534  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
17535 
17536  /* "View.MemoryView":1055
17537  * __Pyx_memviewslice *mslice) except NULL:
17538  * cdef _memoryviewslice obj
17539  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17540  * obj = memview
17541  * return &obj.from_slice
17542  */
17543  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17544  __pyx_t_2 = (__pyx_t_1 != 0);
17545  if (__pyx_t_2) {
17546 
17547  /* "View.MemoryView":1056
17548  * cdef _memoryviewslice obj
17549  * if isinstance(memview, _memoryviewslice):
17550  * obj = memview # <<<<<<<<<<<<<<
17551  * return &obj.from_slice
17552  * else:
17553  */
17554  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
17555  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
17556  __Pyx_INCREF(__pyx_t_3);
17557  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
17558  __pyx_t_3 = 0;
17559 
17560  /* "View.MemoryView":1057
17561  * if isinstance(memview, _memoryviewslice):
17562  * obj = memview
17563  * return &obj.from_slice # <<<<<<<<<<<<<<
17564  * else:
17565  * slice_copy(memview, mslice)
17566  */
17567  __pyx_r = (&__pyx_v_obj->from_slice);
17568  goto __pyx_L0;
17569 
17570  /* "View.MemoryView":1055
17571  * __Pyx_memviewslice *mslice) except NULL:
17572  * cdef _memoryviewslice obj
17573  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17574  * obj = memview
17575  * return &obj.from_slice
17576  */
17577  }
17578 
17579  /* "View.MemoryView":1059
17580  * return &obj.from_slice
17581  * else:
17582  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
17583  * return mslice
17584  *
17585  */
17586  /*else*/ {
17587  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
17588 
17589  /* "View.MemoryView":1060
17590  * else:
17591  * slice_copy(memview, mslice)
17592  * return mslice # <<<<<<<<<<<<<<
17593  *
17594  * @cname('__pyx_memoryview_slice_copy')
17595  */
17596  __pyx_r = __pyx_v_mslice;
17597  goto __pyx_L0;
17598  }
17599 
17600  /* "View.MemoryView":1052
17601  *
17602  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17603  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
17604  * __Pyx_memviewslice *mslice) except NULL:
17605  * cdef _memoryviewslice obj
17606  */
17607 
17608  /* function exit code */
17609  __pyx_L1_error:;
17610  __Pyx_XDECREF(__pyx_t_3);
17611  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
17612  __pyx_r = NULL;
17613  __pyx_L0:;
17614  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
17615  __Pyx_RefNannyFinishContext();
17616  return __pyx_r;
17617 }
17618 
17619 /* "View.MemoryView":1063
17620  *
17621  * @cname('__pyx_memoryview_slice_copy')
17622  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
17623  * cdef int dim
17624  * cdef (Py_ssize_t*) shape, strides, suboffsets
17625  */
17626 
17627 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
17628  int __pyx_v_dim;
17629  Py_ssize_t *__pyx_v_shape;
17630  Py_ssize_t *__pyx_v_strides;
17631  Py_ssize_t *__pyx_v_suboffsets;
17632  __Pyx_RefNannyDeclarations
17633  Py_ssize_t *__pyx_t_1;
17634  int __pyx_t_2;
17635  int __pyx_t_3;
17636  int __pyx_t_4;
17637  Py_ssize_t __pyx_t_5;
17638  __Pyx_RefNannySetupContext("slice_copy", 0);
17639 
17640  /* "View.MemoryView":1067
17641  * cdef (Py_ssize_t*) shape, strides, suboffsets
17642  *
17643  * shape = memview.view.shape # <<<<<<<<<<<<<<
17644  * strides = memview.view.strides
17645  * suboffsets = memview.view.suboffsets
17646  */
17647  __pyx_t_1 = __pyx_v_memview->view.shape;
17648  __pyx_v_shape = __pyx_t_1;
17649 
17650  /* "View.MemoryView":1068
17651  *
17652  * shape = memview.view.shape
17653  * strides = memview.view.strides # <<<<<<<<<<<<<<
17654  * suboffsets = memview.view.suboffsets
17655  *
17656  */
17657  __pyx_t_1 = __pyx_v_memview->view.strides;
17658  __pyx_v_strides = __pyx_t_1;
17659 
17660  /* "View.MemoryView":1069
17661  * shape = memview.view.shape
17662  * strides = memview.view.strides
17663  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
17664  *
17665  * dst.memview = <__pyx_memoryview *> memview
17666  */
17667  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
17668  __pyx_v_suboffsets = __pyx_t_1;
17669 
17670  /* "View.MemoryView":1071
17671  * suboffsets = memview.view.suboffsets
17672  *
17673  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
17674  * dst.data = <char *> memview.view.buf
17675  *
17676  */
17677  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
17678 
17679  /* "View.MemoryView":1072
17680  *
17681  * dst.memview = <__pyx_memoryview *> memview
17682  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
17683  *
17684  * for dim in range(memview.view.ndim):
17685  */
17686  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
17687 
17688  /* "View.MemoryView":1074
17689  * dst.data = <char *> memview.view.buf
17690  *
17691  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
17692  * dst.shape[dim] = shape[dim]
17693  * dst.strides[dim] = strides[dim]
17694  */
17695  __pyx_t_2 = __pyx_v_memview->view.ndim;
17696  __pyx_t_3 = __pyx_t_2;
17697  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17698  __pyx_v_dim = __pyx_t_4;
17699 
17700  /* "View.MemoryView":1075
17701  *
17702  * for dim in range(memview.view.ndim):
17703  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
17704  * dst.strides[dim] = strides[dim]
17705  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
17706  */
17707  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
17708 
17709  /* "View.MemoryView":1076
17710  * for dim in range(memview.view.ndim):
17711  * dst.shape[dim] = shape[dim]
17712  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
17713  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
17714  *
17715  */
17716  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
17717 
17718  /* "View.MemoryView":1077
17719  * dst.shape[dim] = shape[dim]
17720  * dst.strides[dim] = strides[dim]
17721  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
17722  *
17723  * @cname('__pyx_memoryview_copy_object')
17724  */
17725  if ((__pyx_v_suboffsets != 0)) {
17726  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
17727  } else {
17728  __pyx_t_5 = -1L;
17729  }
17730  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
17731  }
17732 
17733  /* "View.MemoryView":1063
17734  *
17735  * @cname('__pyx_memoryview_slice_copy')
17736  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
17737  * cdef int dim
17738  * cdef (Py_ssize_t*) shape, strides, suboffsets
17739  */
17740 
17741  /* function exit code */
17742  __Pyx_RefNannyFinishContext();
17743 }
17744 
17745 /* "View.MemoryView":1080
17746  *
17747  * @cname('__pyx_memoryview_copy_object')
17748  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
17749  * "Create a new memoryview object"
17750  * cdef __Pyx_memviewslice memviewslice
17751  */
17752 
17753 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
17754  __Pyx_memviewslice __pyx_v_memviewslice;
17755  PyObject *__pyx_r = NULL;
17756  __Pyx_RefNannyDeclarations
17757  PyObject *__pyx_t_1 = NULL;
17758  int __pyx_lineno = 0;
17759  const char *__pyx_filename = NULL;
17760  int __pyx_clineno = 0;
17761  __Pyx_RefNannySetupContext("memoryview_copy", 0);
17762 
17763  /* "View.MemoryView":1083
17764  * "Create a new memoryview object"
17765  * cdef __Pyx_memviewslice memviewslice
17766  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
17767  * return memoryview_copy_from_slice(memview, &memviewslice)
17768  *
17769  */
17770  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
17771 
17772  /* "View.MemoryView":1084
17773  * cdef __Pyx_memviewslice memviewslice
17774  * slice_copy(memview, &memviewslice)
17775  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
17776  *
17777  * @cname('__pyx_memoryview_copy_object_from_slice')
17778  */
17779  __Pyx_XDECREF(__pyx_r);
17780  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
17781  __Pyx_GOTREF(__pyx_t_1);
17782  __pyx_r = __pyx_t_1;
17783  __pyx_t_1 = 0;
17784  goto __pyx_L0;
17785 
17786  /* "View.MemoryView":1080
17787  *
17788  * @cname('__pyx_memoryview_copy_object')
17789  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
17790  * "Create a new memoryview object"
17791  * cdef __Pyx_memviewslice memviewslice
17792  */
17793 
17794  /* function exit code */
17795  __pyx_L1_error:;
17796  __Pyx_XDECREF(__pyx_t_1);
17797  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
17798  __pyx_r = 0;
17799  __pyx_L0:;
17800  __Pyx_XGIVEREF(__pyx_r);
17801  __Pyx_RefNannyFinishContext();
17802  return __pyx_r;
17803 }
17804 
17805 /* "View.MemoryView":1087
17806  *
17807  * @cname('__pyx_memoryview_copy_object_from_slice')
17808  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
17809  * """
17810  * Create a new memoryview object from a given memoryview object and slice.
17811  */
17812 
17813 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
17814  PyObject *(*__pyx_v_to_object_func)(char *);
17815  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
17816  PyObject *__pyx_r = NULL;
17817  __Pyx_RefNannyDeclarations
17818  int __pyx_t_1;
17819  int __pyx_t_2;
17820  PyObject *(*__pyx_t_3)(char *);
17821  int (*__pyx_t_4)(char *, PyObject *);
17822  PyObject *__pyx_t_5 = NULL;
17823  int __pyx_lineno = 0;
17824  const char *__pyx_filename = NULL;
17825  int __pyx_clineno = 0;
17826  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
17827 
17828  /* "View.MemoryView":1094
17829  * cdef int (*to_dtype_func)(char *, object) except 0
17830  *
17831  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17832  * to_object_func = (<_memoryviewslice> memview).to_object_func
17833  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17834  */
17835  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17836  __pyx_t_2 = (__pyx_t_1 != 0);
17837  if (__pyx_t_2) {
17838 
17839  /* "View.MemoryView":1095
17840  *
17841  * if isinstance(memview, _memoryviewslice):
17842  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
17843  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17844  * else:
17845  */
17846  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
17847  __pyx_v_to_object_func = __pyx_t_3;
17848 
17849  /* "View.MemoryView":1096
17850  * if isinstance(memview, _memoryviewslice):
17851  * to_object_func = (<_memoryviewslice> memview).to_object_func
17852  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
17853  * else:
17854  * to_object_func = NULL
17855  */
17856  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
17857  __pyx_v_to_dtype_func = __pyx_t_4;
17858 
17859  /* "View.MemoryView":1094
17860  * cdef int (*to_dtype_func)(char *, object) except 0
17861  *
17862  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17863  * to_object_func = (<_memoryviewslice> memview).to_object_func
17864  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17865  */
17866  goto __pyx_L3;
17867  }
17868 
17869  /* "View.MemoryView":1098
17870  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17871  * else:
17872  * to_object_func = NULL # <<<<<<<<<<<<<<
17873  * to_dtype_func = NULL
17874  *
17875  */
17876  /*else*/ {
17877  __pyx_v_to_object_func = NULL;
17878 
17879  /* "View.MemoryView":1099
17880  * else:
17881  * to_object_func = NULL
17882  * to_dtype_func = NULL # <<<<<<<<<<<<<<
17883  *
17884  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
17885  */
17886  __pyx_v_to_dtype_func = NULL;
17887  }
17888  __pyx_L3:;
17889 
17890  /* "View.MemoryView":1101
17891  * to_dtype_func = NULL
17892  *
17893  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
17894  * to_object_func, to_dtype_func,
17895  * memview.dtype_is_object)
17896  */
17897  __Pyx_XDECREF(__pyx_r);
17898 
17899  /* "View.MemoryView":1103
17900  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
17901  * to_object_func, to_dtype_func,
17902  * memview.dtype_is_object) # <<<<<<<<<<<<<<
17903  *
17904  *
17905  */
17906  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
17907  __Pyx_GOTREF(__pyx_t_5);
17908  __pyx_r = __pyx_t_5;
17909  __pyx_t_5 = 0;
17910  goto __pyx_L0;
17911 
17912  /* "View.MemoryView":1087
17913  *
17914  * @cname('__pyx_memoryview_copy_object_from_slice')
17915  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
17916  * """
17917  * Create a new memoryview object from a given memoryview object and slice.
17918  */
17919 
17920  /* function exit code */
17921  __pyx_L1_error:;
17922  __Pyx_XDECREF(__pyx_t_5);
17923  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17924  __pyx_r = 0;
17925  __pyx_L0:;
17926  __Pyx_XGIVEREF(__pyx_r);
17927  __Pyx_RefNannyFinishContext();
17928  return __pyx_r;
17929 }
17930 
17931 /* "View.MemoryView":1109
17932  *
17933  *
17934  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
17935  * if arg < 0:
17936  * return -arg
17937  */
17938 
17939 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
17940  Py_ssize_t __pyx_r;
17941  int __pyx_t_1;
17942 
17943  /* "View.MemoryView":1110
17944  *
17945  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17946  * if arg < 0: # <<<<<<<<<<<<<<
17947  * return -arg
17948  * else:
17949  */
17950  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
17951  if (__pyx_t_1) {
17952 
17953  /* "View.MemoryView":1111
17954  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17955  * if arg < 0:
17956  * return -arg # <<<<<<<<<<<<<<
17957  * else:
17958  * return arg
17959  */
17960  __pyx_r = (-__pyx_v_arg);
17961  goto __pyx_L0;
17962 
17963  /* "View.MemoryView":1110
17964  *
17965  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17966  * if arg < 0: # <<<<<<<<<<<<<<
17967  * return -arg
17968  * else:
17969  */
17970  }
17971 
17972  /* "View.MemoryView":1113
17973  * return -arg
17974  * else:
17975  * return arg # <<<<<<<<<<<<<<
17976  *
17977  * @cname('__pyx_get_best_slice_order')
17978  */
17979  /*else*/ {
17980  __pyx_r = __pyx_v_arg;
17981  goto __pyx_L0;
17982  }
17983 
17984  /* "View.MemoryView":1109
17985  *
17986  *
17987  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
17988  * if arg < 0:
17989  * return -arg
17990  */
17991 
17992  /* function exit code */
17993  __pyx_L0:;
17994  return __pyx_r;
17995 }
17996 
17997 /* "View.MemoryView":1116
17998  *
17999  * @cname('__pyx_get_best_slice_order')
18000  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18001  * """
18002  * Figure out the best memory access order for a given slice.
18003  */
18004 
18005 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
18006  int __pyx_v_i;
18007  Py_ssize_t __pyx_v_c_stride;
18008  Py_ssize_t __pyx_v_f_stride;
18009  char __pyx_r;
18010  int __pyx_t_1;
18011  int __pyx_t_2;
18012  int __pyx_t_3;
18013  int __pyx_t_4;
18014 
18015  /* "View.MemoryView":1121
18016  * """
18017  * cdef int i
18018  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
18019  * cdef Py_ssize_t f_stride = 0
18020  *
18021  */
18022  __pyx_v_c_stride = 0;
18023 
18024  /* "View.MemoryView":1122
18025  * cdef int i
18026  * cdef Py_ssize_t c_stride = 0
18027  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
18028  *
18029  * for i in range(ndim - 1, -1, -1):
18030  */
18031  __pyx_v_f_stride = 0;
18032 
18033  /* "View.MemoryView":1124
18034  * cdef Py_ssize_t f_stride = 0
18035  *
18036  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18037  * if mslice.shape[i] > 1:
18038  * c_stride = mslice.strides[i]
18039  */
18040  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18041  __pyx_v_i = __pyx_t_1;
18042 
18043  /* "View.MemoryView":1125
18044  *
18045  * for i in range(ndim - 1, -1, -1):
18046  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18047  * c_stride = mslice.strides[i]
18048  * break
18049  */
18050  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18051  if (__pyx_t_2) {
18052 
18053  /* "View.MemoryView":1126
18054  * for i in range(ndim - 1, -1, -1):
18055  * if mslice.shape[i] > 1:
18056  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18057  * break
18058  *
18059  */
18060  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18061 
18062  /* "View.MemoryView":1127
18063  * if mslice.shape[i] > 1:
18064  * c_stride = mslice.strides[i]
18065  * break # <<<<<<<<<<<<<<
18066  *
18067  * for i in range(ndim):
18068  */
18069  goto __pyx_L4_break;
18070 
18071  /* "View.MemoryView":1125
18072  *
18073  * for i in range(ndim - 1, -1, -1):
18074  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18075  * c_stride = mslice.strides[i]
18076  * break
18077  */
18078  }
18079  }
18080  __pyx_L4_break:;
18081 
18082  /* "View.MemoryView":1129
18083  * break
18084  *
18085  * for i in range(ndim): # <<<<<<<<<<<<<<
18086  * if mslice.shape[i] > 1:
18087  * f_stride = mslice.strides[i]
18088  */
18089  __pyx_t_1 = __pyx_v_ndim;
18090  __pyx_t_3 = __pyx_t_1;
18091  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18092  __pyx_v_i = __pyx_t_4;
18093 
18094  /* "View.MemoryView":1130
18095  *
18096  * for i in range(ndim):
18097  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18098  * f_stride = mslice.strides[i]
18099  * break
18100  */
18101  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18102  if (__pyx_t_2) {
18103 
18104  /* "View.MemoryView":1131
18105  * for i in range(ndim):
18106  * if mslice.shape[i] > 1:
18107  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18108  * break
18109  *
18110  */
18111  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18112 
18113  /* "View.MemoryView":1132
18114  * if mslice.shape[i] > 1:
18115  * f_stride = mslice.strides[i]
18116  * break # <<<<<<<<<<<<<<
18117  *
18118  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18119  */
18120  goto __pyx_L7_break;
18121 
18122  /* "View.MemoryView":1130
18123  *
18124  * for i in range(ndim):
18125  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18126  * f_stride = mslice.strides[i]
18127  * break
18128  */
18129  }
18130  }
18131  __pyx_L7_break:;
18132 
18133  /* "View.MemoryView":1134
18134  * break
18135  *
18136  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18137  * return 'C'
18138  * else:
18139  */
18140  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18141  if (__pyx_t_2) {
18142 
18143  /* "View.MemoryView":1135
18144  *
18145  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18146  * return 'C' # <<<<<<<<<<<<<<
18147  * else:
18148  * return 'F'
18149  */
18150  __pyx_r = 'C';
18151  goto __pyx_L0;
18152 
18153  /* "View.MemoryView":1134
18154  * break
18155  *
18156  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18157  * return 'C'
18158  * else:
18159  */
18160  }
18161 
18162  /* "View.MemoryView":1137
18163  * return 'C'
18164  * else:
18165  * return 'F' # <<<<<<<<<<<<<<
18166  *
18167  * @cython.cdivision(True)
18168  */
18169  /*else*/ {
18170  __pyx_r = 'F';
18171  goto __pyx_L0;
18172  }
18173 
18174  /* "View.MemoryView":1116
18175  *
18176  * @cname('__pyx_get_best_slice_order')
18177  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18178  * """
18179  * Figure out the best memory access order for a given slice.
18180  */
18181 
18182  /* function exit code */
18183  __pyx_L0:;
18184  return __pyx_r;
18185 }
18186 
18187 /* "View.MemoryView":1140
18188  *
18189  * @cython.cdivision(True)
18190  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18191  * char *dst_data, Py_ssize_t *dst_strides,
18192  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18193  */
18194 
18195 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
18196  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18197  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18198  Py_ssize_t __pyx_v_dst_extent;
18199  Py_ssize_t __pyx_v_src_stride;
18200  Py_ssize_t __pyx_v_dst_stride;
18201  int __pyx_t_1;
18202  int __pyx_t_2;
18203  int __pyx_t_3;
18204  Py_ssize_t __pyx_t_4;
18205  Py_ssize_t __pyx_t_5;
18206  Py_ssize_t __pyx_t_6;
18207 
18208  /* "View.MemoryView":1147
18209  *
18210  * cdef Py_ssize_t i
18211  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
18212  * cdef Py_ssize_t dst_extent = dst_shape[0]
18213  * cdef Py_ssize_t src_stride = src_strides[0]
18214  */
18215  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18216 
18217  /* "View.MemoryView":1148
18218  * cdef Py_ssize_t i
18219  * cdef Py_ssize_t src_extent = src_shape[0]
18220  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
18221  * cdef Py_ssize_t src_stride = src_strides[0]
18222  * cdef Py_ssize_t dst_stride = dst_strides[0]
18223  */
18224  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18225 
18226  /* "View.MemoryView":1149
18227  * cdef Py_ssize_t src_extent = src_shape[0]
18228  * cdef Py_ssize_t dst_extent = dst_shape[0]
18229  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
18230  * cdef Py_ssize_t dst_stride = dst_strides[0]
18231  *
18232  */
18233  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18234 
18235  /* "View.MemoryView":1150
18236  * cdef Py_ssize_t dst_extent = dst_shape[0]
18237  * cdef Py_ssize_t src_stride = src_strides[0]
18238  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
18239  *
18240  * if ndim == 1:
18241  */
18242  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18243 
18244  /* "View.MemoryView":1152
18245  * cdef Py_ssize_t dst_stride = dst_strides[0]
18246  *
18247  * if ndim == 1: # <<<<<<<<<<<<<<
18248  * if (src_stride > 0 and dst_stride > 0 and
18249  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18250  */
18251  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18252  if (__pyx_t_1) {
18253 
18254  /* "View.MemoryView":1153
18255  *
18256  * if ndim == 1:
18257  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18258  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18259  * memcpy(dst_data, src_data, itemsize * dst_extent)
18260  */
18261  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18262  if (__pyx_t_2) {
18263  } else {
18264  __pyx_t_1 = __pyx_t_2;
18265  goto __pyx_L5_bool_binop_done;
18266  }
18267  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18268  if (__pyx_t_2) {
18269  } else {
18270  __pyx_t_1 = __pyx_t_2;
18271  goto __pyx_L5_bool_binop_done;
18272  }
18273 
18274  /* "View.MemoryView":1154
18275  * if ndim == 1:
18276  * if (src_stride > 0 and dst_stride > 0 and
18277  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
18278  * memcpy(dst_data, src_data, itemsize * dst_extent)
18279  * else:
18280  */
18281  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18282  if (__pyx_t_2) {
18283  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18284  }
18285  __pyx_t_3 = (__pyx_t_2 != 0);
18286  __pyx_t_1 = __pyx_t_3;
18287  __pyx_L5_bool_binop_done:;
18288 
18289  /* "View.MemoryView":1153
18290  *
18291  * if ndim == 1:
18292  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18293  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18294  * memcpy(dst_data, src_data, itemsize * dst_extent)
18295  */
18296  if (__pyx_t_1) {
18297 
18298  /* "View.MemoryView":1155
18299  * if (src_stride > 0 and dst_stride > 0 and
18300  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18301  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
18302  * else:
18303  * for i in range(dst_extent):
18304  */
18305  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18306 
18307  /* "View.MemoryView":1153
18308  *
18309  * if ndim == 1:
18310  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18311  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18312  * memcpy(dst_data, src_data, itemsize * dst_extent)
18313  */
18314  goto __pyx_L4;
18315  }
18316 
18317  /* "View.MemoryView":1157
18318  * memcpy(dst_data, src_data, itemsize * dst_extent)
18319  * else:
18320  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18321  * memcpy(dst_data, src_data, itemsize)
18322  * src_data += src_stride
18323  */
18324  /*else*/ {
18325  __pyx_t_4 = __pyx_v_dst_extent;
18326  __pyx_t_5 = __pyx_t_4;
18327  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18328  __pyx_v_i = __pyx_t_6;
18329 
18330  /* "View.MemoryView":1158
18331  * else:
18332  * for i in range(dst_extent):
18333  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
18334  * src_data += src_stride
18335  * dst_data += dst_stride
18336  */
18337  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18338 
18339  /* "View.MemoryView":1159
18340  * for i in range(dst_extent):
18341  * memcpy(dst_data, src_data, itemsize)
18342  * src_data += src_stride # <<<<<<<<<<<<<<
18343  * dst_data += dst_stride
18344  * else:
18345  */
18346  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18347 
18348  /* "View.MemoryView":1160
18349  * memcpy(dst_data, src_data, itemsize)
18350  * src_data += src_stride
18351  * dst_data += dst_stride # <<<<<<<<<<<<<<
18352  * else:
18353  * for i in range(dst_extent):
18354  */
18355  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18356  }
18357  }
18358  __pyx_L4:;
18359 
18360  /* "View.MemoryView":1152
18361  * cdef Py_ssize_t dst_stride = dst_strides[0]
18362  *
18363  * if ndim == 1: # <<<<<<<<<<<<<<
18364  * if (src_stride > 0 and dst_stride > 0 and
18365  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18366  */
18367  goto __pyx_L3;
18368  }
18369 
18370  /* "View.MemoryView":1162
18371  * dst_data += dst_stride
18372  * else:
18373  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18374  * _copy_strided_to_strided(src_data, src_strides + 1,
18375  * dst_data, dst_strides + 1,
18376  */
18377  /*else*/ {
18378  __pyx_t_4 = __pyx_v_dst_extent;
18379  __pyx_t_5 = __pyx_t_4;
18380  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18381  __pyx_v_i = __pyx_t_6;
18382 
18383  /* "View.MemoryView":1163
18384  * else:
18385  * for i in range(dst_extent):
18386  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
18387  * dst_data, dst_strides + 1,
18388  * src_shape + 1, dst_shape + 1,
18389  */
18390  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
18391 
18392  /* "View.MemoryView":1167
18393  * src_shape + 1, dst_shape + 1,
18394  * ndim - 1, itemsize)
18395  * src_data += src_stride # <<<<<<<<<<<<<<
18396  * dst_data += dst_stride
18397  *
18398  */
18399  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18400 
18401  /* "View.MemoryView":1168
18402  * ndim - 1, itemsize)
18403  * src_data += src_stride
18404  * dst_data += dst_stride # <<<<<<<<<<<<<<
18405  *
18406  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
18407  */
18408  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18409  }
18410  }
18411  __pyx_L3:;
18412 
18413  /* "View.MemoryView":1140
18414  *
18415  * @cython.cdivision(True)
18416  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18417  * char *dst_data, Py_ssize_t *dst_strides,
18418  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18419  */
18420 
18421  /* function exit code */
18422 }
18423 
18424 /* "View.MemoryView":1170
18425  * dst_data += dst_stride
18426  *
18427  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18428  * __Pyx_memviewslice *dst,
18429  * int ndim, size_t itemsize) nogil:
18430  */
18431 
18432 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
18433 
18434  /* "View.MemoryView":1173
18435  * __Pyx_memviewslice *dst,
18436  * int ndim, size_t itemsize) nogil:
18437  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
18438  * src.shape, dst.shape, ndim, itemsize)
18439  *
18440  */
18441  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
18442 
18443  /* "View.MemoryView":1170
18444  * dst_data += dst_stride
18445  *
18446  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18447  * __Pyx_memviewslice *dst,
18448  * int ndim, size_t itemsize) nogil:
18449  */
18450 
18451  /* function exit code */
18452 }
18453 
18454 /* "View.MemoryView":1177
18455  *
18456  * @cname('__pyx_memoryview_slice_get_size')
18457  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18458  * "Return the size of the memory occupied by the slice in number of bytes"
18459  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18460  */
18461 
18462 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
18463  Py_ssize_t __pyx_v_shape;
18464  Py_ssize_t __pyx_v_size;
18465  Py_ssize_t __pyx_r;
18466  Py_ssize_t __pyx_t_1;
18467  Py_ssize_t *__pyx_t_2;
18468  Py_ssize_t *__pyx_t_3;
18469  Py_ssize_t *__pyx_t_4;
18470 
18471  /* "View.MemoryView":1179
18472  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
18473  * "Return the size of the memory occupied by the slice in number of bytes"
18474  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
18475  *
18476  * for shape in src.shape[:ndim]:
18477  */
18478  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18479  __pyx_v_size = __pyx_t_1;
18480 
18481  /* "View.MemoryView":1181
18482  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18483  *
18484  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
18485  * size *= shape
18486  *
18487  */
18488  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
18489  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
18490  __pyx_t_2 = __pyx_t_4;
18491  __pyx_v_shape = (__pyx_t_2[0]);
18492 
18493  /* "View.MemoryView":1182
18494  *
18495  * for shape in src.shape[:ndim]:
18496  * size *= shape # <<<<<<<<<<<<<<
18497  *
18498  * return size
18499  */
18500  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
18501  }
18502 
18503  /* "View.MemoryView":1184
18504  * size *= shape
18505  *
18506  * return size # <<<<<<<<<<<<<<
18507  *
18508  * @cname('__pyx_fill_contig_strides_array')
18509  */
18510  __pyx_r = __pyx_v_size;
18511  goto __pyx_L0;
18512 
18513  /* "View.MemoryView":1177
18514  *
18515  * @cname('__pyx_memoryview_slice_get_size')
18516  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18517  * "Return the size of the memory occupied by the slice in number of bytes"
18518  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18519  */
18520 
18521  /* function exit code */
18522  __pyx_L0:;
18523  return __pyx_r;
18524 }
18525 
18526 /* "View.MemoryView":1187
18527  *
18528  * @cname('__pyx_fill_contig_strides_array')
18529  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
18530  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18531  * int ndim, char order) nogil:
18532  */
18533 
18534 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
18535  int __pyx_v_idx;
18536  Py_ssize_t __pyx_r;
18537  int __pyx_t_1;
18538  int __pyx_t_2;
18539  int __pyx_t_3;
18540  int __pyx_t_4;
18541 
18542  /* "View.MemoryView":1196
18543  * cdef int idx
18544  *
18545  * if order == 'F': # <<<<<<<<<<<<<<
18546  * for idx in range(ndim):
18547  * strides[idx] = stride
18548  */
18549  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
18550  if (__pyx_t_1) {
18551 
18552  /* "View.MemoryView":1197
18553  *
18554  * if order == 'F':
18555  * for idx in range(ndim): # <<<<<<<<<<<<<<
18556  * strides[idx] = stride
18557  * stride *= shape[idx]
18558  */
18559  __pyx_t_2 = __pyx_v_ndim;
18560  __pyx_t_3 = __pyx_t_2;
18561  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18562  __pyx_v_idx = __pyx_t_4;
18563 
18564  /* "View.MemoryView":1198
18565  * if order == 'F':
18566  * for idx in range(ndim):
18567  * strides[idx] = stride # <<<<<<<<<<<<<<
18568  * stride *= shape[idx]
18569  * else:
18570  */
18571  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18572 
18573  /* "View.MemoryView":1199
18574  * for idx in range(ndim):
18575  * strides[idx] = stride
18576  * stride *= shape[idx] # <<<<<<<<<<<<<<
18577  * else:
18578  * for idx in range(ndim - 1, -1, -1):
18579  */
18580  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18581  }
18582 
18583  /* "View.MemoryView":1196
18584  * cdef int idx
18585  *
18586  * if order == 'F': # <<<<<<<<<<<<<<
18587  * for idx in range(ndim):
18588  * strides[idx] = stride
18589  */
18590  goto __pyx_L3;
18591  }
18592 
18593  /* "View.MemoryView":1201
18594  * stride *= shape[idx]
18595  * else:
18596  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18597  * strides[idx] = stride
18598  * stride *= shape[idx]
18599  */
18600  /*else*/ {
18601  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
18602  __pyx_v_idx = __pyx_t_2;
18603 
18604  /* "View.MemoryView":1202
18605  * else:
18606  * for idx in range(ndim - 1, -1, -1):
18607  * strides[idx] = stride # <<<<<<<<<<<<<<
18608  * stride *= shape[idx]
18609  *
18610  */
18611  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18612 
18613  /* "View.MemoryView":1203
18614  * for idx in range(ndim - 1, -1, -1):
18615  * strides[idx] = stride
18616  * stride *= shape[idx] # <<<<<<<<<<<<<<
18617  *
18618  * return stride
18619  */
18620  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18621  }
18622  }
18623  __pyx_L3:;
18624 
18625  /* "View.MemoryView":1205
18626  * stride *= shape[idx]
18627  *
18628  * return stride # <<<<<<<<<<<<<<
18629  *
18630  * @cname('__pyx_memoryview_copy_data_to_temp')
18631  */
18632  __pyx_r = __pyx_v_stride;
18633  goto __pyx_L0;
18634 
18635  /* "View.MemoryView":1187
18636  *
18637  * @cname('__pyx_fill_contig_strides_array')
18638  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
18639  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18640  * int ndim, char order) nogil:
18641  */
18642 
18643  /* function exit code */
18644  __pyx_L0:;
18645  return __pyx_r;
18646 }
18647 
18648 /* "View.MemoryView":1208
18649  *
18650  * @cname('__pyx_memoryview_copy_data_to_temp')
18651  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18652  * __Pyx_memviewslice *tmpslice,
18653  * char order,
18654  */
18655 
18656 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
18657  int __pyx_v_i;
18658  void *__pyx_v_result;
18659  size_t __pyx_v_itemsize;
18660  size_t __pyx_v_size;
18661  void *__pyx_r;
18662  Py_ssize_t __pyx_t_1;
18663  int __pyx_t_2;
18664  int __pyx_t_3;
18665  struct __pyx_memoryview_obj *__pyx_t_4;
18666  int __pyx_t_5;
18667  int __pyx_t_6;
18668  int __pyx_lineno = 0;
18669  const char *__pyx_filename = NULL;
18670  int __pyx_clineno = 0;
18671 
18672  /* "View.MemoryView":1219
18673  * cdef void *result
18674  *
18675  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
18676  * cdef size_t size = slice_get_size(src, ndim)
18677  *
18678  */
18679  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18680  __pyx_v_itemsize = __pyx_t_1;
18681 
18682  /* "View.MemoryView":1220
18683  *
18684  * cdef size_t itemsize = src.memview.view.itemsize
18685  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
18686  *
18687  * result = malloc(size)
18688  */
18689  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
18690 
18691  /* "View.MemoryView":1222
18692  * cdef size_t size = slice_get_size(src, ndim)
18693  *
18694  * result = malloc(size) # <<<<<<<<<<<<<<
18695  * if not result:
18696  * _err(MemoryError, NULL)
18697  */
18698  __pyx_v_result = malloc(__pyx_v_size);
18699 
18700  /* "View.MemoryView":1223
18701  *
18702  * result = malloc(size)
18703  * if not result: # <<<<<<<<<<<<<<
18704  * _err(MemoryError, NULL)
18705  *
18706  */
18707  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
18708  if (__pyx_t_2) {
18709 
18710  /* "View.MemoryView":1224
18711  * result = malloc(size)
18712  * if not result:
18713  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
18714  *
18715  *
18716  */
18717  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
18718 
18719  /* "View.MemoryView":1223
18720  *
18721  * result = malloc(size)
18722  * if not result: # <<<<<<<<<<<<<<
18723  * _err(MemoryError, NULL)
18724  *
18725  */
18726  }
18727 
18728  /* "View.MemoryView":1227
18729  *
18730  *
18731  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
18732  * tmpslice.memview = src.memview
18733  * for i in range(ndim):
18734  */
18735  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
18736 
18737  /* "View.MemoryView":1228
18738  *
18739  * tmpslice.data = <char *> result
18740  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
18741  * for i in range(ndim):
18742  * tmpslice.shape[i] = src.shape[i]
18743  */
18744  __pyx_t_4 = __pyx_v_src->memview;
18745  __pyx_v_tmpslice->memview = __pyx_t_4;
18746 
18747  /* "View.MemoryView":1229
18748  * tmpslice.data = <char *> result
18749  * tmpslice.memview = src.memview
18750  * for i in range(ndim): # <<<<<<<<<<<<<<
18751  * tmpslice.shape[i] = src.shape[i]
18752  * tmpslice.suboffsets[i] = -1
18753  */
18754  __pyx_t_3 = __pyx_v_ndim;
18755  __pyx_t_5 = __pyx_t_3;
18756  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18757  __pyx_v_i = __pyx_t_6;
18758 
18759  /* "View.MemoryView":1230
18760  * tmpslice.memview = src.memview
18761  * for i in range(ndim):
18762  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
18763  * tmpslice.suboffsets[i] = -1
18764  *
18765  */
18766  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
18767 
18768  /* "View.MemoryView":1231
18769  * for i in range(ndim):
18770  * tmpslice.shape[i] = src.shape[i]
18771  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
18772  *
18773  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
18774  */
18775  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
18776  }
18777 
18778  /* "View.MemoryView":1233
18779  * tmpslice.suboffsets[i] = -1
18780  *
18781  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
18782  * ndim, order)
18783  *
18784  */
18785  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
18786 
18787  /* "View.MemoryView":1237
18788  *
18789  *
18790  * for i in range(ndim): # <<<<<<<<<<<<<<
18791  * if tmpslice.shape[i] == 1:
18792  * tmpslice.strides[i] = 0
18793  */
18794  __pyx_t_3 = __pyx_v_ndim;
18795  __pyx_t_5 = __pyx_t_3;
18796  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18797  __pyx_v_i = __pyx_t_6;
18798 
18799  /* "View.MemoryView":1238
18800  *
18801  * for i in range(ndim):
18802  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
18803  * tmpslice.strides[i] = 0
18804  *
18805  */
18806  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
18807  if (__pyx_t_2) {
18808 
18809  /* "View.MemoryView":1239
18810  * for i in range(ndim):
18811  * if tmpslice.shape[i] == 1:
18812  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
18813  *
18814  * if slice_is_contig(src[0], order, ndim):
18815  */
18816  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
18817 
18818  /* "View.MemoryView":1238
18819  *
18820  * for i in range(ndim):
18821  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
18822  * tmpslice.strides[i] = 0
18823  *
18824  */
18825  }
18826  }
18827 
18828  /* "View.MemoryView":1241
18829  * tmpslice.strides[i] = 0
18830  *
18831  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
18832  * memcpy(result, src.data, size)
18833  * else:
18834  */
18835  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
18836  if (__pyx_t_2) {
18837 
18838  /* "View.MemoryView":1242
18839  *
18840  * if slice_is_contig(src[0], order, ndim):
18841  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
18842  * else:
18843  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
18844  */
18845  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
18846 
18847  /* "View.MemoryView":1241
18848  * tmpslice.strides[i] = 0
18849  *
18850  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
18851  * memcpy(result, src.data, size)
18852  * else:
18853  */
18854  goto __pyx_L9;
18855  }
18856 
18857  /* "View.MemoryView":1244
18858  * memcpy(result, src.data, size)
18859  * else:
18860  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
18861  *
18862  * return result
18863  */
18864  /*else*/ {
18865  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
18866  }
18867  __pyx_L9:;
18868 
18869  /* "View.MemoryView":1246
18870  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
18871  *
18872  * return result # <<<<<<<<<<<<<<
18873  *
18874  *
18875  */
18876  __pyx_r = __pyx_v_result;
18877  goto __pyx_L0;
18878 
18879  /* "View.MemoryView":1208
18880  *
18881  * @cname('__pyx_memoryview_copy_data_to_temp')
18882  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18883  * __Pyx_memviewslice *tmpslice,
18884  * char order,
18885  */
18886 
18887  /* function exit code */
18888  __pyx_L1_error:;
18889  {
18890  #ifdef WITH_THREAD
18891  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18892  #endif
18893  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
18894  #ifdef WITH_THREAD
18895  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18896  #endif
18897  }
18898  __pyx_r = NULL;
18899  __pyx_L0:;
18900  return __pyx_r;
18901 }
18902 
18903 /* "View.MemoryView":1251
18904  *
18905  * @cname('__pyx_memoryview_err_extents')
18906  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
18907  * Py_ssize_t extent2) except -1 with gil:
18908  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18909  */
18910 
18911 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
18912  int __pyx_r;
18913  __Pyx_RefNannyDeclarations
18914  PyObject *__pyx_t_1 = NULL;
18915  PyObject *__pyx_t_2 = NULL;
18916  PyObject *__pyx_t_3 = NULL;
18917  PyObject *__pyx_t_4 = NULL;
18918  int __pyx_lineno = 0;
18919  const char *__pyx_filename = NULL;
18920  int __pyx_clineno = 0;
18921  #ifdef WITH_THREAD
18922  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18923  #endif
18924  __Pyx_RefNannySetupContext("_err_extents", 0);
18925 
18926  /* "View.MemoryView":1254
18927  * Py_ssize_t extent2) except -1 with gil:
18928  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18929  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
18930  *
18931  * @cname('__pyx_memoryview_err_dim')
18932  */
18933  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
18934  __Pyx_GOTREF(__pyx_t_1);
18935  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
18936  __Pyx_GOTREF(__pyx_t_2);
18937  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
18938  __Pyx_GOTREF(__pyx_t_3);
18939  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
18940  __Pyx_GOTREF(__pyx_t_4);
18941  __Pyx_GIVEREF(__pyx_t_1);
18942  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
18943  __Pyx_GIVEREF(__pyx_t_2);
18944  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
18945  __Pyx_GIVEREF(__pyx_t_3);
18946  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
18947  __pyx_t_1 = 0;
18948  __pyx_t_2 = 0;
18949  __pyx_t_3 = 0;
18950 
18951  /* "View.MemoryView":1253
18952  * cdef int _err_extents(int i, Py_ssize_t extent1,
18953  * Py_ssize_t extent2) except -1 with gil:
18954  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
18955  * (i, extent1, extent2))
18956  *
18957  */
18958  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
18959  __Pyx_GOTREF(__pyx_t_3);
18960  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18961  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
18962  __Pyx_GOTREF(__pyx_t_4);
18963  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18964  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
18965  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18966  __PYX_ERR(1, 1253, __pyx_L1_error)
18967 
18968  /* "View.MemoryView":1251
18969  *
18970  * @cname('__pyx_memoryview_err_extents')
18971  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
18972  * Py_ssize_t extent2) except -1 with gil:
18973  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18974  */
18975 
18976  /* function exit code */
18977  __pyx_L1_error:;
18978  __Pyx_XDECREF(__pyx_t_1);
18979  __Pyx_XDECREF(__pyx_t_2);
18980  __Pyx_XDECREF(__pyx_t_3);
18981  __Pyx_XDECREF(__pyx_t_4);
18982  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
18983  __pyx_r = -1;
18984  __Pyx_RefNannyFinishContext();
18985  #ifdef WITH_THREAD
18986  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18987  #endif
18988  return __pyx_r;
18989 }
18990 
18991 /* "View.MemoryView":1257
18992  *
18993  * @cname('__pyx_memoryview_err_dim')
18994  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
18995  * raise error(msg.decode('ascii') % dim)
18996  *
18997  */
18998 
18999 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
19000  int __pyx_r;
19001  __Pyx_RefNannyDeclarations
19002  PyObject *__pyx_t_1 = NULL;
19003  PyObject *__pyx_t_2 = NULL;
19004  PyObject *__pyx_t_3 = NULL;
19005  PyObject *__pyx_t_4 = NULL;
19006  int __pyx_lineno = 0;
19007  const char *__pyx_filename = NULL;
19008  int __pyx_clineno = 0;
19009  #ifdef WITH_THREAD
19010  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19011  #endif
19012  __Pyx_RefNannySetupContext("_err_dim", 0);
19013  __Pyx_INCREF(__pyx_v_error);
19014 
19015  /* "View.MemoryView":1258
19016  * @cname('__pyx_memoryview_err_dim')
19017  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
19018  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
19019  *
19020  * @cname('__pyx_memoryview_err')
19021  */
19022  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
19023  __Pyx_GOTREF(__pyx_t_2);
19024  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
19025  __Pyx_GOTREF(__pyx_t_3);
19026  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
19027  __Pyx_GOTREF(__pyx_t_4);
19028  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19029  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19030  __Pyx_INCREF(__pyx_v_error);
19031  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19032  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19033  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19034  if (likely(__pyx_t_2)) {
19035  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
19036  __Pyx_INCREF(__pyx_t_2);
19037  __Pyx_INCREF(function);
19038  __Pyx_DECREF_SET(__pyx_t_3, function);
19039  }
19040  }
19041  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
19042  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19043  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19044  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
19045  __Pyx_GOTREF(__pyx_t_1);
19046  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19047  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19048  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19049  __PYX_ERR(1, 1258, __pyx_L1_error)
19050 
19051  /* "View.MemoryView":1257
19052  *
19053  * @cname('__pyx_memoryview_err_dim')
19054  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19055  * raise error(msg.decode('ascii') % dim)
19056  *
19057  */
19058 
19059  /* function exit code */
19060  __pyx_L1_error:;
19061  __Pyx_XDECREF(__pyx_t_1);
19062  __Pyx_XDECREF(__pyx_t_2);
19063  __Pyx_XDECREF(__pyx_t_3);
19064  __Pyx_XDECREF(__pyx_t_4);
19065  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19066  __pyx_r = -1;
19067  __Pyx_XDECREF(__pyx_v_error);
19068  __Pyx_RefNannyFinishContext();
19069  #ifdef WITH_THREAD
19070  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19071  #endif
19072  return __pyx_r;
19073 }
19074 
19075 /* "View.MemoryView":1261
19076  *
19077  * @cname('__pyx_memoryview_err')
19078  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19079  * if msg != NULL:
19080  * raise error(msg.decode('ascii'))
19081  */
19082 
19083 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
19084  int __pyx_r;
19085  __Pyx_RefNannyDeclarations
19086  int __pyx_t_1;
19087  PyObject *__pyx_t_2 = NULL;
19088  PyObject *__pyx_t_3 = NULL;
19089  PyObject *__pyx_t_4 = NULL;
19090  PyObject *__pyx_t_5 = NULL;
19091  int __pyx_lineno = 0;
19092  const char *__pyx_filename = NULL;
19093  int __pyx_clineno = 0;
19094  #ifdef WITH_THREAD
19095  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19096  #endif
19097  __Pyx_RefNannySetupContext("_err", 0);
19098  __Pyx_INCREF(__pyx_v_error);
19099 
19100  /* "View.MemoryView":1262
19101  * @cname('__pyx_memoryview_err')
19102  * cdef int _err(object error, char *msg) except -1 with gil:
19103  * if msg != NULL: # <<<<<<<<<<<<<<
19104  * raise error(msg.decode('ascii'))
19105  * else:
19106  */
19107  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19108  if (unlikely(__pyx_t_1)) {
19109 
19110  /* "View.MemoryView":1263
19111  * cdef int _err(object error, char *msg) except -1 with gil:
19112  * if msg != NULL:
19113  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
19114  * else:
19115  * raise error
19116  */
19117  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
19118  __Pyx_GOTREF(__pyx_t_3);
19119  __Pyx_INCREF(__pyx_v_error);
19120  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19121  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19122  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19123  if (likely(__pyx_t_5)) {
19124  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
19125  __Pyx_INCREF(__pyx_t_5);
19126  __Pyx_INCREF(function);
19127  __Pyx_DECREF_SET(__pyx_t_4, function);
19128  }
19129  }
19130  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
19131  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19132  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19133  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
19134  __Pyx_GOTREF(__pyx_t_2);
19135  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19136  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19137  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19138  __PYX_ERR(1, 1263, __pyx_L1_error)
19139 
19140  /* "View.MemoryView":1262
19141  * @cname('__pyx_memoryview_err')
19142  * cdef int _err(object error, char *msg) except -1 with gil:
19143  * if msg != NULL: # <<<<<<<<<<<<<<
19144  * raise error(msg.decode('ascii'))
19145  * else:
19146  */
19147  }
19148 
19149  /* "View.MemoryView":1265
19150  * raise error(msg.decode('ascii'))
19151  * else:
19152  * raise error # <<<<<<<<<<<<<<
19153  *
19154  * @cname('__pyx_memoryview_copy_contents')
19155  */
19156  /*else*/ {
19157  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19158  __PYX_ERR(1, 1265, __pyx_L1_error)
19159  }
19160 
19161  /* "View.MemoryView":1261
19162  *
19163  * @cname('__pyx_memoryview_err')
19164  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19165  * if msg != NULL:
19166  * raise error(msg.decode('ascii'))
19167  */
19168 
19169  /* function exit code */
19170  __pyx_L1_error:;
19171  __Pyx_XDECREF(__pyx_t_2);
19172  __Pyx_XDECREF(__pyx_t_3);
19173  __Pyx_XDECREF(__pyx_t_4);
19174  __Pyx_XDECREF(__pyx_t_5);
19175  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19176  __pyx_r = -1;
19177  __Pyx_XDECREF(__pyx_v_error);
19178  __Pyx_RefNannyFinishContext();
19179  #ifdef WITH_THREAD
19180  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19181  #endif
19182  return __pyx_r;
19183 }
19184 
19185 /* "View.MemoryView":1268
19186  *
19187  * @cname('__pyx_memoryview_copy_contents')
19188  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
19189  * __Pyx_memviewslice dst,
19190  * int src_ndim, int dst_ndim,
19191  */
19192 
19193 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
19194  void *__pyx_v_tmpdata;
19195  size_t __pyx_v_itemsize;
19196  int __pyx_v_i;
19197  char __pyx_v_order;
19198  int __pyx_v_broadcasting;
19199  int __pyx_v_direct_copy;
19200  __Pyx_memviewslice __pyx_v_tmp;
19201  int __pyx_v_ndim;
19202  int __pyx_r;
19203  Py_ssize_t __pyx_t_1;
19204  int __pyx_t_2;
19205  int __pyx_t_3;
19206  int __pyx_t_4;
19207  int __pyx_t_5;
19208  int __pyx_t_6;
19209  void *__pyx_t_7;
19210  int __pyx_t_8;
19211  int __pyx_lineno = 0;
19212  const char *__pyx_filename = NULL;
19213  int __pyx_clineno = 0;
19214 
19215  /* "View.MemoryView":1276
19216  * Check for overlapping memory and verify the shapes.
19217  * """
19218  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
19219  * cdef size_t itemsize = src.memview.view.itemsize
19220  * cdef int i
19221  */
19222  __pyx_v_tmpdata = NULL;
19223 
19224  /* "View.MemoryView":1277
19225  * """
19226  * cdef void *tmpdata = NULL
19227  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19228  * cdef int i
19229  * cdef char order = get_best_order(&src, src_ndim)
19230  */
19231  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19232  __pyx_v_itemsize = __pyx_t_1;
19233 
19234  /* "View.MemoryView":1279
19235  * cdef size_t itemsize = src.memview.view.itemsize
19236  * cdef int i
19237  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
19238  * cdef bint broadcasting = False
19239  * cdef bint direct_copy = False
19240  */
19241  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19242 
19243  /* "View.MemoryView":1280
19244  * cdef int i
19245  * cdef char order = get_best_order(&src, src_ndim)
19246  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
19247  * cdef bint direct_copy = False
19248  * cdef __Pyx_memviewslice tmp
19249  */
19250  __pyx_v_broadcasting = 0;
19251 
19252  /* "View.MemoryView":1281
19253  * cdef char order = get_best_order(&src, src_ndim)
19254  * cdef bint broadcasting = False
19255  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
19256  * cdef __Pyx_memviewslice tmp
19257  *
19258  */
19259  __pyx_v_direct_copy = 0;
19260 
19261  /* "View.MemoryView":1284
19262  * cdef __Pyx_memviewslice tmp
19263  *
19264  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19265  * broadcast_leading(&src, src_ndim, dst_ndim)
19266  * elif dst_ndim < src_ndim:
19267  */
19268  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19269  if (__pyx_t_2) {
19270 
19271  /* "View.MemoryView":1285
19272  *
19273  * if src_ndim < dst_ndim:
19274  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19275  * elif dst_ndim < src_ndim:
19276  * broadcast_leading(&dst, dst_ndim, src_ndim)
19277  */
19278  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19279 
19280  /* "View.MemoryView":1284
19281  * cdef __Pyx_memviewslice tmp
19282  *
19283  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19284  * broadcast_leading(&src, src_ndim, dst_ndim)
19285  * elif dst_ndim < src_ndim:
19286  */
19287  goto __pyx_L3;
19288  }
19289 
19290  /* "View.MemoryView":1286
19291  * if src_ndim < dst_ndim:
19292  * broadcast_leading(&src, src_ndim, dst_ndim)
19293  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19294  * broadcast_leading(&dst, dst_ndim, src_ndim)
19295  *
19296  */
19297  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19298  if (__pyx_t_2) {
19299 
19300  /* "View.MemoryView":1287
19301  * broadcast_leading(&src, src_ndim, dst_ndim)
19302  * elif dst_ndim < src_ndim:
19303  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
19304  *
19305  * cdef int ndim = max(src_ndim, dst_ndim)
19306  */
19307  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19308 
19309  /* "View.MemoryView":1286
19310  * if src_ndim < dst_ndim:
19311  * broadcast_leading(&src, src_ndim, dst_ndim)
19312  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19313  * broadcast_leading(&dst, dst_ndim, src_ndim)
19314  *
19315  */
19316  }
19317  __pyx_L3:;
19318 
19319  /* "View.MemoryView":1289
19320  * broadcast_leading(&dst, dst_ndim, src_ndim)
19321  *
19322  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19323  *
19324  * for i in range(ndim):
19325  */
19326  __pyx_t_3 = __pyx_v_dst_ndim;
19327  __pyx_t_4 = __pyx_v_src_ndim;
19328  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19329  __pyx_t_5 = __pyx_t_3;
19330  } else {
19331  __pyx_t_5 = __pyx_t_4;
19332  }
19333  __pyx_v_ndim = __pyx_t_5;
19334 
19335  /* "View.MemoryView":1291
19336  * cdef int ndim = max(src_ndim, dst_ndim)
19337  *
19338  * for i in range(ndim): # <<<<<<<<<<<<<<
19339  * if src.shape[i] != dst.shape[i]:
19340  * if src.shape[i] == 1:
19341  */
19342  __pyx_t_5 = __pyx_v_ndim;
19343  __pyx_t_3 = __pyx_t_5;
19344  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19345  __pyx_v_i = __pyx_t_4;
19346 
19347  /* "View.MemoryView":1292
19348  *
19349  * for i in range(ndim):
19350  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19351  * if src.shape[i] == 1:
19352  * broadcasting = True
19353  */
19354  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19355  if (__pyx_t_2) {
19356 
19357  /* "View.MemoryView":1293
19358  * for i in range(ndim):
19359  * if src.shape[i] != dst.shape[i]:
19360  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19361  * broadcasting = True
19362  * src.strides[i] = 0
19363  */
19364  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19365  if (__pyx_t_2) {
19366 
19367  /* "View.MemoryView":1294
19368  * if src.shape[i] != dst.shape[i]:
19369  * if src.shape[i] == 1:
19370  * broadcasting = True # <<<<<<<<<<<<<<
19371  * src.strides[i] = 0
19372  * else:
19373  */
19374  __pyx_v_broadcasting = 1;
19375 
19376  /* "View.MemoryView":1295
19377  * if src.shape[i] == 1:
19378  * broadcasting = True
19379  * src.strides[i] = 0 # <<<<<<<<<<<<<<
19380  * else:
19381  * _err_extents(i, dst.shape[i], src.shape[i])
19382  */
19383  (__pyx_v_src.strides[__pyx_v_i]) = 0;
19384 
19385  /* "View.MemoryView":1293
19386  * for i in range(ndim):
19387  * if src.shape[i] != dst.shape[i]:
19388  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19389  * broadcasting = True
19390  * src.strides[i] = 0
19391  */
19392  goto __pyx_L7;
19393  }
19394 
19395  /* "View.MemoryView":1297
19396  * src.strides[i] = 0
19397  * else:
19398  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
19399  *
19400  * if src.suboffsets[i] >= 0:
19401  */
19402  /*else*/ {
19403  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
19404  }
19405  __pyx_L7:;
19406 
19407  /* "View.MemoryView":1292
19408  *
19409  * for i in range(ndim):
19410  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19411  * if src.shape[i] == 1:
19412  * broadcasting = True
19413  */
19414  }
19415 
19416  /* "View.MemoryView":1299
19417  * _err_extents(i, dst.shape[i], src.shape[i])
19418  *
19419  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19420  * _err_dim(ValueError, "Dimension %d is not direct", i)
19421  *
19422  */
19423  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19424  if (__pyx_t_2) {
19425 
19426  /* "View.MemoryView":1300
19427  *
19428  * if src.suboffsets[i] >= 0:
19429  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
19430  *
19431  * if slices_overlap(&src, &dst, ndim, itemsize):
19432  */
19433  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
19434 
19435  /* "View.MemoryView":1299
19436  * _err_extents(i, dst.shape[i], src.shape[i])
19437  *
19438  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19439  * _err_dim(ValueError, "Dimension %d is not direct", i)
19440  *
19441  */
19442  }
19443  }
19444 
19445  /* "View.MemoryView":1302
19446  * _err_dim(ValueError, "Dimension %d is not direct", i)
19447  *
19448  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
19449  *
19450  * if not slice_is_contig(src, order, ndim):
19451  */
19452  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
19453  if (__pyx_t_2) {
19454 
19455  /* "View.MemoryView":1304
19456  * if slices_overlap(&src, &dst, ndim, itemsize):
19457  *
19458  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
19459  * order = get_best_order(&dst, ndim)
19460  *
19461  */
19462  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
19463  if (__pyx_t_2) {
19464 
19465  /* "View.MemoryView":1305
19466  *
19467  * if not slice_is_contig(src, order, ndim):
19468  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
19469  *
19470  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19471  */
19472  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19473 
19474  /* "View.MemoryView":1304
19475  * if slices_overlap(&src, &dst, ndim, itemsize):
19476  *
19477  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
19478  * order = get_best_order(&dst, ndim)
19479  *
19480  */
19481  }
19482 
19483  /* "View.MemoryView":1307
19484  * order = get_best_order(&dst, ndim)
19485  *
19486  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
19487  * src = tmp
19488  *
19489  */
19490  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
19491  __pyx_v_tmpdata = __pyx_t_7;
19492 
19493  /* "View.MemoryView":1308
19494  *
19495  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19496  * src = tmp # <<<<<<<<<<<<<<
19497  *
19498  * if not broadcasting:
19499  */
19500  __pyx_v_src = __pyx_v_tmp;
19501 
19502  /* "View.MemoryView":1302
19503  * _err_dim(ValueError, "Dimension %d is not direct", i)
19504  *
19505  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
19506  *
19507  * if not slice_is_contig(src, order, ndim):
19508  */
19509  }
19510 
19511  /* "View.MemoryView":1310
19512  * src = tmp
19513  *
19514  * if not broadcasting: # <<<<<<<<<<<<<<
19515  *
19516  *
19517  */
19518  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19519  if (__pyx_t_2) {
19520 
19521  /* "View.MemoryView":1313
19522  *
19523  *
19524  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
19525  * direct_copy = slice_is_contig(dst, 'C', ndim)
19526  * elif slice_is_contig(src, 'F', ndim):
19527  */
19528  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
19529  if (__pyx_t_2) {
19530 
19531  /* "View.MemoryView":1314
19532  *
19533  * if slice_is_contig(src, 'C', ndim):
19534  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
19535  * elif slice_is_contig(src, 'F', ndim):
19536  * direct_copy = slice_is_contig(dst, 'F', ndim)
19537  */
19538  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
19539 
19540  /* "View.MemoryView":1313
19541  *
19542  *
19543  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
19544  * direct_copy = slice_is_contig(dst, 'C', ndim)
19545  * elif slice_is_contig(src, 'F', ndim):
19546  */
19547  goto __pyx_L12;
19548  }
19549 
19550  /* "View.MemoryView":1315
19551  * if slice_is_contig(src, 'C', ndim):
19552  * direct_copy = slice_is_contig(dst, 'C', ndim)
19553  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
19554  * direct_copy = slice_is_contig(dst, 'F', ndim)
19555  *
19556  */
19557  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
19558  if (__pyx_t_2) {
19559 
19560  /* "View.MemoryView":1316
19561  * direct_copy = slice_is_contig(dst, 'C', ndim)
19562  * elif slice_is_contig(src, 'F', ndim):
19563  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
19564  *
19565  * if direct_copy:
19566  */
19567  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
19568 
19569  /* "View.MemoryView":1315
19570  * if slice_is_contig(src, 'C', ndim):
19571  * direct_copy = slice_is_contig(dst, 'C', ndim)
19572  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
19573  * direct_copy = slice_is_contig(dst, 'F', ndim)
19574  *
19575  */
19576  }
19577  __pyx_L12:;
19578 
19579  /* "View.MemoryView":1318
19580  * direct_copy = slice_is_contig(dst, 'F', ndim)
19581  *
19582  * if direct_copy: # <<<<<<<<<<<<<<
19583  *
19584  * refcount_copying(&dst, dtype_is_object, ndim, False)
19585  */
19586  __pyx_t_2 = (__pyx_v_direct_copy != 0);
19587  if (__pyx_t_2) {
19588 
19589  /* "View.MemoryView":1320
19590  * if direct_copy:
19591  *
19592  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
19593  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19594  * refcount_copying(&dst, dtype_is_object, ndim, True)
19595  */
19596  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19597 
19598  /* "View.MemoryView":1321
19599  *
19600  * refcount_copying(&dst, dtype_is_object, ndim, False)
19601  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
19602  * refcount_copying(&dst, dtype_is_object, ndim, True)
19603  * free(tmpdata)
19604  */
19605  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
19606 
19607  /* "View.MemoryView":1322
19608  * refcount_copying(&dst, dtype_is_object, ndim, False)
19609  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19610  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
19611  * free(tmpdata)
19612  * return 0
19613  */
19614  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19615 
19616  /* "View.MemoryView":1323
19617  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19618  * refcount_copying(&dst, dtype_is_object, ndim, True)
19619  * free(tmpdata) # <<<<<<<<<<<<<<
19620  * return 0
19621  *
19622  */
19623  free(__pyx_v_tmpdata);
19624 
19625  /* "View.MemoryView":1324
19626  * refcount_copying(&dst, dtype_is_object, ndim, True)
19627  * free(tmpdata)
19628  * return 0 # <<<<<<<<<<<<<<
19629  *
19630  * if order == 'F' == get_best_order(&dst, ndim):
19631  */
19632  __pyx_r = 0;
19633  goto __pyx_L0;
19634 
19635  /* "View.MemoryView":1318
19636  * direct_copy = slice_is_contig(dst, 'F', ndim)
19637  *
19638  * if direct_copy: # <<<<<<<<<<<<<<
19639  *
19640  * refcount_copying(&dst, dtype_is_object, ndim, False)
19641  */
19642  }
19643 
19644  /* "View.MemoryView":1310
19645  * src = tmp
19646  *
19647  * if not broadcasting: # <<<<<<<<<<<<<<
19648  *
19649  *
19650  */
19651  }
19652 
19653  /* "View.MemoryView":1326
19654  * return 0
19655  *
19656  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
19657  *
19658  *
19659  */
19660  __pyx_t_2 = (__pyx_v_order == 'F');
19661  if (__pyx_t_2) {
19662  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
19663  }
19664  __pyx_t_8 = (__pyx_t_2 != 0);
19665  if (__pyx_t_8) {
19666 
19667  /* "View.MemoryView":1329
19668  *
19669  *
19670  * transpose_memslice(&src) # <<<<<<<<<<<<<<
19671  * transpose_memslice(&dst)
19672  *
19673  */
19674  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
19675 
19676  /* "View.MemoryView":1330
19677  *
19678  * transpose_memslice(&src)
19679  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
19680  *
19681  * refcount_copying(&dst, dtype_is_object, ndim, False)
19682  */
19683  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
19684 
19685  /* "View.MemoryView":1326
19686  * return 0
19687  *
19688  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
19689  *
19690  *
19691  */
19692  }
19693 
19694  /* "View.MemoryView":1332
19695  * transpose_memslice(&dst)
19696  *
19697  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
19698  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
19699  * refcount_copying(&dst, dtype_is_object, ndim, True)
19700  */
19701  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19702 
19703  /* "View.MemoryView":1333
19704  *
19705  * refcount_copying(&dst, dtype_is_object, ndim, False)
19706  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
19707  * refcount_copying(&dst, dtype_is_object, ndim, True)
19708  *
19709  */
19710  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
19711 
19712  /* "View.MemoryView":1334
19713  * refcount_copying(&dst, dtype_is_object, ndim, False)
19714  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
19715  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
19716  *
19717  * free(tmpdata)
19718  */
19719  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19720 
19721  /* "View.MemoryView":1336
19722  * refcount_copying(&dst, dtype_is_object, ndim, True)
19723  *
19724  * free(tmpdata) # <<<<<<<<<<<<<<
19725  * return 0
19726  *
19727  */
19728  free(__pyx_v_tmpdata);
19729 
19730  /* "View.MemoryView":1337
19731  *
19732  * free(tmpdata)
19733  * return 0 # <<<<<<<<<<<<<<
19734  *
19735  * @cname('__pyx_memoryview_broadcast_leading')
19736  */
19737  __pyx_r = 0;
19738  goto __pyx_L0;
19739 
19740  /* "View.MemoryView":1268
19741  *
19742  * @cname('__pyx_memoryview_copy_contents')
19743  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
19744  * __Pyx_memviewslice dst,
19745  * int src_ndim, int dst_ndim,
19746  */
19747 
19748  /* function exit code */
19749  __pyx_L1_error:;
19750  {
19751  #ifdef WITH_THREAD
19752  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19753  #endif
19754  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19755  #ifdef WITH_THREAD
19756  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19757  #endif
19758  }
19759  __pyx_r = -1;
19760  __pyx_L0:;
19761  return __pyx_r;
19762 }
19763 
19764 /* "View.MemoryView":1340
19765  *
19766  * @cname('__pyx_memoryview_broadcast_leading')
19767  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
19768  * int ndim,
19769  * int ndim_other) nogil:
19770  */
19771 
19772 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
19773  int __pyx_v_i;
19774  int __pyx_v_offset;
19775  int __pyx_t_1;
19776  int __pyx_t_2;
19777  int __pyx_t_3;
19778 
19779  /* "View.MemoryView":1344
19780  * int ndim_other) nogil:
19781  * cdef int i
19782  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
19783  *
19784  * for i in range(ndim - 1, -1, -1):
19785  */
19786  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
19787 
19788  /* "View.MemoryView":1346
19789  * cdef int offset = ndim_other - ndim
19790  *
19791  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19792  * mslice.shape[i + offset] = mslice.shape[i]
19793  * mslice.strides[i + offset] = mslice.strides[i]
19794  */
19795  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
19796  __pyx_v_i = __pyx_t_1;
19797 
19798  /* "View.MemoryView":1347
19799  *
19800  * for i in range(ndim - 1, -1, -1):
19801  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
19802  * mslice.strides[i + offset] = mslice.strides[i]
19803  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19804  */
19805  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
19806 
19807  /* "View.MemoryView":1348
19808  * for i in range(ndim - 1, -1, -1):
19809  * mslice.shape[i + offset] = mslice.shape[i]
19810  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
19811  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19812  *
19813  */
19814  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
19815 
19816  /* "View.MemoryView":1349
19817  * mslice.shape[i + offset] = mslice.shape[i]
19818  * mslice.strides[i + offset] = mslice.strides[i]
19819  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
19820  *
19821  * for i in range(offset):
19822  */
19823  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
19824  }
19825 
19826  /* "View.MemoryView":1351
19827  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19828  *
19829  * for i in range(offset): # <<<<<<<<<<<<<<
19830  * mslice.shape[i] = 1
19831  * mslice.strides[i] = mslice.strides[0]
19832  */
19833  __pyx_t_1 = __pyx_v_offset;
19834  __pyx_t_2 = __pyx_t_1;
19835  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19836  __pyx_v_i = __pyx_t_3;
19837 
19838  /* "View.MemoryView":1352
19839  *
19840  * for i in range(offset):
19841  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
19842  * mslice.strides[i] = mslice.strides[0]
19843  * mslice.suboffsets[i] = -1
19844  */
19845  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
19846 
19847  /* "View.MemoryView":1353
19848  * for i in range(offset):
19849  * mslice.shape[i] = 1
19850  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
19851  * mslice.suboffsets[i] = -1
19852  *
19853  */
19854  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
19855 
19856  /* "View.MemoryView":1354
19857  * mslice.shape[i] = 1
19858  * mslice.strides[i] = mslice.strides[0]
19859  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
19860  *
19861  *
19862  */
19863  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
19864  }
19865 
19866  /* "View.MemoryView":1340
19867  *
19868  * @cname('__pyx_memoryview_broadcast_leading')
19869  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
19870  * int ndim,
19871  * int ndim_other) nogil:
19872  */
19873 
19874  /* function exit code */
19875 }
19876 
19877 /* "View.MemoryView":1362
19878  *
19879  * @cname('__pyx_memoryview_refcount_copying')
19880  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
19881  * int ndim, bint inc) nogil:
19882  *
19883  */
19884 
19885 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
19886  int __pyx_t_1;
19887 
19888  /* "View.MemoryView":1366
19889  *
19890  *
19891  * if dtype_is_object: # <<<<<<<<<<<<<<
19892  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
19893  * dst.strides, ndim, inc)
19894  */
19895  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
19896  if (__pyx_t_1) {
19897 
19898  /* "View.MemoryView":1367
19899  *
19900  * if dtype_is_object:
19901  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
19902  * dst.strides, ndim, inc)
19903  *
19904  */
19905  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
19906 
19907  /* "View.MemoryView":1366
19908  *
19909  *
19910  * if dtype_is_object: # <<<<<<<<<<<<<<
19911  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
19912  * dst.strides, ndim, inc)
19913  */
19914  }
19915 
19916  /* "View.MemoryView":1362
19917  *
19918  * @cname('__pyx_memoryview_refcount_copying')
19919  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
19920  * int ndim, bint inc) nogil:
19921  *
19922  */
19923 
19924  /* function exit code */
19925 }
19926 
19927 /* "View.MemoryView":1371
19928  *
19929  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
19930  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19931  * Py_ssize_t *strides, int ndim,
19932  * bint inc) with gil:
19933  */
19934 
19935 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
19936  __Pyx_RefNannyDeclarations
19937  #ifdef WITH_THREAD
19938  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19939  #endif
19940  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
19941 
19942  /* "View.MemoryView":1374
19943  * Py_ssize_t *strides, int ndim,
19944  * bint inc) with gil:
19945  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
19946  *
19947  * @cname('__pyx_memoryview_refcount_objects_in_slice')
19948  */
19949  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
19950 
19951  /* "View.MemoryView":1371
19952  *
19953  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
19954  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19955  * Py_ssize_t *strides, int ndim,
19956  * bint inc) with gil:
19957  */
19958 
19959  /* function exit code */
19960  __Pyx_RefNannyFinishContext();
19961  #ifdef WITH_THREAD
19962  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19963  #endif
19964 }
19965 
19966 /* "View.MemoryView":1377
19967  *
19968  * @cname('__pyx_memoryview_refcount_objects_in_slice')
19969  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19970  * Py_ssize_t *strides, int ndim, bint inc):
19971  * cdef Py_ssize_t i
19972  */
19973 
19974 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
19975  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19976  __Pyx_RefNannyDeclarations
19977  Py_ssize_t __pyx_t_1;
19978  Py_ssize_t __pyx_t_2;
19979  Py_ssize_t __pyx_t_3;
19980  int __pyx_t_4;
19981  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
19982 
19983  /* "View.MemoryView":1381
19984  * cdef Py_ssize_t i
19985  *
19986  * for i in range(shape[0]): # <<<<<<<<<<<<<<
19987  * if ndim == 1:
19988  * if inc:
19989  */
19990  __pyx_t_1 = (__pyx_v_shape[0]);
19991  __pyx_t_2 = __pyx_t_1;
19992  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19993  __pyx_v_i = __pyx_t_3;
19994 
19995  /* "View.MemoryView":1382
19996  *
19997  * for i in range(shape[0]):
19998  * if ndim == 1: # <<<<<<<<<<<<<<
19999  * if inc:
20000  * Py_INCREF((<PyObject **> data)[0])
20001  */
20002  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20003  if (__pyx_t_4) {
20004 
20005  /* "View.MemoryView":1383
20006  * for i in range(shape[0]):
20007  * if ndim == 1:
20008  * if inc: # <<<<<<<<<<<<<<
20009  * Py_INCREF((<PyObject **> data)[0])
20010  * else:
20011  */
20012  __pyx_t_4 = (__pyx_v_inc != 0);
20013  if (__pyx_t_4) {
20014 
20015  /* "View.MemoryView":1384
20016  * if ndim == 1:
20017  * if inc:
20018  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20019  * else:
20020  * Py_DECREF((<PyObject **> data)[0])
20021  */
20022  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20023 
20024  /* "View.MemoryView":1383
20025  * for i in range(shape[0]):
20026  * if ndim == 1:
20027  * if inc: # <<<<<<<<<<<<<<
20028  * Py_INCREF((<PyObject **> data)[0])
20029  * else:
20030  */
20031  goto __pyx_L6;
20032  }
20033 
20034  /* "View.MemoryView":1386
20035  * Py_INCREF((<PyObject **> data)[0])
20036  * else:
20037  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20038  * else:
20039  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20040  */
20041  /*else*/ {
20042  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20043  }
20044  __pyx_L6:;
20045 
20046  /* "View.MemoryView":1382
20047  *
20048  * for i in range(shape[0]):
20049  * if ndim == 1: # <<<<<<<<<<<<<<
20050  * if inc:
20051  * Py_INCREF((<PyObject **> data)[0])
20052  */
20053  goto __pyx_L5;
20054  }
20055 
20056  /* "View.MemoryView":1388
20057  * Py_DECREF((<PyObject **> data)[0])
20058  * else:
20059  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20060  * ndim - 1, inc)
20061  *
20062  */
20063  /*else*/ {
20064 
20065  /* "View.MemoryView":1389
20066  * else:
20067  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20068  * ndim - 1, inc) # <<<<<<<<<<<<<<
20069  *
20070  * data += strides[0]
20071  */
20072  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20073  }
20074  __pyx_L5:;
20075 
20076  /* "View.MemoryView":1391
20077  * ndim - 1, inc)
20078  *
20079  * data += strides[0] # <<<<<<<<<<<<<<
20080  *
20081  *
20082  */
20083  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20084  }
20085 
20086  /* "View.MemoryView":1377
20087  *
20088  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20089  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20090  * Py_ssize_t *strides, int ndim, bint inc):
20091  * cdef Py_ssize_t i
20092  */
20093 
20094  /* function exit code */
20095  __Pyx_RefNannyFinishContext();
20096 }
20097 
20098 /* "View.MemoryView":1397
20099  *
20100  * @cname('__pyx_memoryview_slice_assign_scalar')
20101  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20102  * size_t itemsize, void *item,
20103  * bint dtype_is_object) nogil:
20104  */
20105 
20106 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
20107 
20108  /* "View.MemoryView":1400
20109  * size_t itemsize, void *item,
20110  * bint dtype_is_object) nogil:
20111  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20112  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20113  * itemsize, item)
20114  */
20115  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20116 
20117  /* "View.MemoryView":1401
20118  * bint dtype_is_object) nogil:
20119  * refcount_copying(dst, dtype_is_object, ndim, False)
20120  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
20121  * itemsize, item)
20122  * refcount_copying(dst, dtype_is_object, ndim, True)
20123  */
20124  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
20125 
20126  /* "View.MemoryView":1403
20127  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20128  * itemsize, item)
20129  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20130  *
20131  *
20132  */
20133  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20134 
20135  /* "View.MemoryView":1397
20136  *
20137  * @cname('__pyx_memoryview_slice_assign_scalar')
20138  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20139  * size_t itemsize, void *item,
20140  * bint dtype_is_object) nogil:
20141  */
20142 
20143  /* function exit code */
20144 }
20145 
20146 /* "View.MemoryView":1407
20147  *
20148  * @cname('__pyx_memoryview__slice_assign_scalar')
20149  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20150  * Py_ssize_t *strides, int ndim,
20151  * size_t itemsize, void *item) nogil:
20152  */
20153 
20154 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
20155  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20156  Py_ssize_t __pyx_v_stride;
20157  Py_ssize_t __pyx_v_extent;
20158  int __pyx_t_1;
20159  Py_ssize_t __pyx_t_2;
20160  Py_ssize_t __pyx_t_3;
20161  Py_ssize_t __pyx_t_4;
20162 
20163  /* "View.MemoryView":1411
20164  * size_t itemsize, void *item) nogil:
20165  * cdef Py_ssize_t i
20166  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
20167  * cdef Py_ssize_t extent = shape[0]
20168  *
20169  */
20170  __pyx_v_stride = (__pyx_v_strides[0]);
20171 
20172  /* "View.MemoryView":1412
20173  * cdef Py_ssize_t i
20174  * cdef Py_ssize_t stride = strides[0]
20175  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
20176  *
20177  * if ndim == 1:
20178  */
20179  __pyx_v_extent = (__pyx_v_shape[0]);
20180 
20181  /* "View.MemoryView":1414
20182  * cdef Py_ssize_t extent = shape[0]
20183  *
20184  * if ndim == 1: # <<<<<<<<<<<<<<
20185  * for i in range(extent):
20186  * memcpy(data, item, itemsize)
20187  */
20188  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20189  if (__pyx_t_1) {
20190 
20191  /* "View.MemoryView":1415
20192  *
20193  * if ndim == 1:
20194  * for i in range(extent): # <<<<<<<<<<<<<<
20195  * memcpy(data, item, itemsize)
20196  * data += stride
20197  */
20198  __pyx_t_2 = __pyx_v_extent;
20199  __pyx_t_3 = __pyx_t_2;
20200  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20201  __pyx_v_i = __pyx_t_4;
20202 
20203  /* "View.MemoryView":1416
20204  * if ndim == 1:
20205  * for i in range(extent):
20206  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
20207  * data += stride
20208  * else:
20209  */
20210  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20211 
20212  /* "View.MemoryView":1417
20213  * for i in range(extent):
20214  * memcpy(data, item, itemsize)
20215  * data += stride # <<<<<<<<<<<<<<
20216  * else:
20217  * for i in range(extent):
20218  */
20219  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20220  }
20221 
20222  /* "View.MemoryView":1414
20223  * cdef Py_ssize_t extent = shape[0]
20224  *
20225  * if ndim == 1: # <<<<<<<<<<<<<<
20226  * for i in range(extent):
20227  * memcpy(data, item, itemsize)
20228  */
20229  goto __pyx_L3;
20230  }
20231 
20232  /* "View.MemoryView":1419
20233  * data += stride
20234  * else:
20235  * for i in range(extent): # <<<<<<<<<<<<<<
20236  * _slice_assign_scalar(data, shape + 1, strides + 1,
20237  * ndim - 1, itemsize, item)
20238  */
20239  /*else*/ {
20240  __pyx_t_2 = __pyx_v_extent;
20241  __pyx_t_3 = __pyx_t_2;
20242  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20243  __pyx_v_i = __pyx_t_4;
20244 
20245  /* "View.MemoryView":1420
20246  * else:
20247  * for i in range(extent):
20248  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20249  * ndim - 1, itemsize, item)
20250  * data += stride
20251  */
20252  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
20253 
20254  /* "View.MemoryView":1422
20255  * _slice_assign_scalar(data, shape + 1, strides + 1,
20256  * ndim - 1, itemsize, item)
20257  * data += stride # <<<<<<<<<<<<<<
20258  *
20259  *
20260  */
20261  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20262  }
20263  }
20264  __pyx_L3:;
20265 
20266  /* "View.MemoryView":1407
20267  *
20268  * @cname('__pyx_memoryview__slice_assign_scalar')
20269  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20270  * Py_ssize_t *strides, int ndim,
20271  * size_t itemsize, void *item) nogil:
20272  */
20273 
20274  /* function exit code */
20275 }
20276 
20277 /* "(tree fragment)":1
20278  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20279  * cdef object __pyx_PickleError
20280  * cdef object __pyx_result
20281  */
20282 
20283 /* Python wrapper */
20284 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
20285 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
20286 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20287  PyObject *__pyx_v___pyx_type = 0;
20288  long __pyx_v___pyx_checksum;
20289  PyObject *__pyx_v___pyx_state = 0;
20290  int __pyx_lineno = 0;
20291  const char *__pyx_filename = NULL;
20292  int __pyx_clineno = 0;
20293  PyObject *__pyx_r = 0;
20294  __Pyx_RefNannyDeclarations
20295  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
20296  {
20297  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20298  PyObject* values[3] = {0,0,0};
20299  if (unlikely(__pyx_kwds)) {
20300  Py_ssize_t kw_args;
20301  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20302  switch (pos_args) {
20303  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20304  CYTHON_FALLTHROUGH;
20305  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20306  CYTHON_FALLTHROUGH;
20307  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20308  CYTHON_FALLTHROUGH;
20309  case 0: break;
20310  default: goto __pyx_L5_argtuple_error;
20311  }
20312  kw_args = PyDict_Size(__pyx_kwds);
20313  switch (pos_args) {
20314  case 0:
20315  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20316  else goto __pyx_L5_argtuple_error;
20317  CYTHON_FALLTHROUGH;
20318  case 1:
20319  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20320  else {
20321  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
20322  }
20323  CYTHON_FALLTHROUGH;
20324  case 2:
20325  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20326  else {
20327  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
20328  }
20329  }
20330  if (unlikely(kw_args > 0)) {
20331  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
20332  }
20333  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20334  goto __pyx_L5_argtuple_error;
20335  } else {
20336  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20337  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20338  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20339  }
20340  __pyx_v___pyx_type = values[0];
20341  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
20342  __pyx_v___pyx_state = values[2];
20343  }
20344  goto __pyx_L4_argument_unpacking_done;
20345  __pyx_L5_argtuple_error:;
20346  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
20347  __pyx_L3_error:;
20348  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20349  __Pyx_RefNannyFinishContext();
20350  return NULL;
20351  __pyx_L4_argument_unpacking_done:;
20352  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20353 
20354  /* function exit code */
20355  __Pyx_RefNannyFinishContext();
20356  return __pyx_r;
20357 }
20358 
20359 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
20360  PyObject *__pyx_v___pyx_PickleError = 0;
20361  PyObject *__pyx_v___pyx_result = 0;
20362  PyObject *__pyx_r = NULL;
20363  __Pyx_RefNannyDeclarations
20364  int __pyx_t_1;
20365  PyObject *__pyx_t_2 = NULL;
20366  PyObject *__pyx_t_3 = NULL;
20367  PyObject *__pyx_t_4 = NULL;
20368  PyObject *__pyx_t_5 = NULL;
20369  int __pyx_t_6;
20370  int __pyx_lineno = 0;
20371  const char *__pyx_filename = NULL;
20372  int __pyx_clineno = 0;
20373  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
20374 
20375  /* "(tree fragment)":4
20376  * cdef object __pyx_PickleError
20377  * cdef object __pyx_result
20378  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
20379  * from pickle import PickleError as __pyx_PickleError
20380  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20381  */
20382  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
20383  if (__pyx_t_1) {
20384 
20385  /* "(tree fragment)":5
20386  * cdef object __pyx_result
20387  * if __pyx_checksum != 0xb068931:
20388  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
20389  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20390  * __pyx_result = Enum.__new__(__pyx_type)
20391  */
20392  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
20393  __Pyx_GOTREF(__pyx_t_2);
20394  __Pyx_INCREF(__pyx_n_s_PickleError);
20395  __Pyx_GIVEREF(__pyx_n_s_PickleError);
20396  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
20397  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
20398  __Pyx_GOTREF(__pyx_t_3);
20399  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20400  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
20401  __Pyx_GOTREF(__pyx_t_2);
20402  __Pyx_INCREF(__pyx_t_2);
20403  __pyx_v___pyx_PickleError = __pyx_t_2;
20404  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20405  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20406 
20407  /* "(tree fragment)":6
20408  * if __pyx_checksum != 0xb068931:
20409  * from pickle import PickleError as __pyx_PickleError
20410  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
20411  * __pyx_result = Enum.__new__(__pyx_type)
20412  * if __pyx_state is not None:
20413  */
20414  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
20415  __Pyx_GOTREF(__pyx_t_2);
20416  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
20417  __Pyx_GOTREF(__pyx_t_4);
20418  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20419  __Pyx_INCREF(__pyx_v___pyx_PickleError);
20420  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
20421  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
20422  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
20423  if (likely(__pyx_t_5)) {
20424  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20425  __Pyx_INCREF(__pyx_t_5);
20426  __Pyx_INCREF(function);
20427  __Pyx_DECREF_SET(__pyx_t_2, function);
20428  }
20429  }
20430  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
20431  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20432  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20433  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
20434  __Pyx_GOTREF(__pyx_t_3);
20435  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20436  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20437  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20438  __PYX_ERR(1, 6, __pyx_L1_error)
20439 
20440  /* "(tree fragment)":4
20441  * cdef object __pyx_PickleError
20442  * cdef object __pyx_result
20443  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
20444  * from pickle import PickleError as __pyx_PickleError
20445  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20446  */
20447  }
20448 
20449  /* "(tree fragment)":7
20450  * from pickle import PickleError as __pyx_PickleError
20451  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20452  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
20453  * if __pyx_state is not None:
20454  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20455  */
20456  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
20457  __Pyx_GOTREF(__pyx_t_2);
20458  __pyx_t_4 = NULL;
20459  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
20460  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
20461  if (likely(__pyx_t_4)) {
20462  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20463  __Pyx_INCREF(__pyx_t_4);
20464  __Pyx_INCREF(function);
20465  __Pyx_DECREF_SET(__pyx_t_2, function);
20466  }
20467  }
20468  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
20469  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
20470  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
20471  __Pyx_GOTREF(__pyx_t_3);
20472  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20473  __pyx_v___pyx_result = __pyx_t_3;
20474  __pyx_t_3 = 0;
20475 
20476  /* "(tree fragment)":8
20477  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20478  * __pyx_result = Enum.__new__(__pyx_type)
20479  * if __pyx_state is not None: # <<<<<<<<<<<<<<
20480  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20481  * return __pyx_result
20482  */
20483  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
20484  __pyx_t_6 = (__pyx_t_1 != 0);
20485  if (__pyx_t_6) {
20486 
20487  /* "(tree fragment)":9
20488  * __pyx_result = Enum.__new__(__pyx_type)
20489  * if __pyx_state is not None:
20490  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
20491  * return __pyx_result
20492  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20493  */
20494  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
20495  __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
20496  __Pyx_GOTREF(__pyx_t_3);
20497  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20498 
20499  /* "(tree fragment)":8
20500  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20501  * __pyx_result = Enum.__new__(__pyx_type)
20502  * if __pyx_state is not None: # <<<<<<<<<<<<<<
20503  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20504  * return __pyx_result
20505  */
20506  }
20507 
20508  /* "(tree fragment)":10
20509  * if __pyx_state is not None:
20510  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20511  * return __pyx_result # <<<<<<<<<<<<<<
20512  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20513  * __pyx_result.name = __pyx_state[0]
20514  */
20515  __Pyx_XDECREF(__pyx_r);
20516  __Pyx_INCREF(__pyx_v___pyx_result);
20517  __pyx_r = __pyx_v___pyx_result;
20518  goto __pyx_L0;
20519 
20520  /* "(tree fragment)":1
20521  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20522  * cdef object __pyx_PickleError
20523  * cdef object __pyx_result
20524  */
20525 
20526  /* function exit code */
20527  __pyx_L1_error:;
20528  __Pyx_XDECREF(__pyx_t_2);
20529  __Pyx_XDECREF(__pyx_t_3);
20530  __Pyx_XDECREF(__pyx_t_4);
20531  __Pyx_XDECREF(__pyx_t_5);
20532  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20533  __pyx_r = NULL;
20534  __pyx_L0:;
20535  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
20536  __Pyx_XDECREF(__pyx_v___pyx_result);
20537  __Pyx_XGIVEREF(__pyx_r);
20538  __Pyx_RefNannyFinishContext();
20539  return __pyx_r;
20540 }
20541 
20542 /* "(tree fragment)":11
20543  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20544  * return __pyx_result
20545  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
20546  * __pyx_result.name = __pyx_state[0]
20547  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20548  */
20549 
20550 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
20551  PyObject *__pyx_r = NULL;
20552  __Pyx_RefNannyDeclarations
20553  PyObject *__pyx_t_1 = NULL;
20554  int __pyx_t_2;
20555  Py_ssize_t __pyx_t_3;
20556  int __pyx_t_4;
20557  int __pyx_t_5;
20558  PyObject *__pyx_t_6 = NULL;
20559  PyObject *__pyx_t_7 = NULL;
20560  PyObject *__pyx_t_8 = NULL;
20561  int __pyx_lineno = 0;
20562  const char *__pyx_filename = NULL;
20563  int __pyx_clineno = 0;
20564  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
20565 
20566  /* "(tree fragment)":12
20567  * return __pyx_result
20568  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20569  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
20570  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20571  * __pyx_result.__dict__.update(__pyx_state[1])
20572  */
20573  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20574  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20575  __PYX_ERR(1, 12, __pyx_L1_error)
20576  }
20577  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
20578  __Pyx_GOTREF(__pyx_t_1);
20579  __Pyx_GIVEREF(__pyx_t_1);
20580  __Pyx_GOTREF(__pyx_v___pyx_result->name);
20581  __Pyx_DECREF(__pyx_v___pyx_result->name);
20582  __pyx_v___pyx_result->name = __pyx_t_1;
20583  __pyx_t_1 = 0;
20584 
20585  /* "(tree fragment)":13
20586  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20587  * __pyx_result.name = __pyx_state[0]
20588  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
20589  * __pyx_result.__dict__.update(__pyx_state[1])
20590  */
20591  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20592  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
20593  __PYX_ERR(1, 13, __pyx_L1_error)
20594  }
20595  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
20596  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
20597  if (__pyx_t_4) {
20598  } else {
20599  __pyx_t_2 = __pyx_t_4;
20600  goto __pyx_L4_bool_binop_done;
20601  }
20602  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
20603  __pyx_t_5 = (__pyx_t_4 != 0);
20604  __pyx_t_2 = __pyx_t_5;
20605  __pyx_L4_bool_binop_done:;
20606  if (__pyx_t_2) {
20607 
20608  /* "(tree fragment)":14
20609  * __pyx_result.name = __pyx_state[0]
20610  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20611  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
20612  */
20613  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
20614  __Pyx_GOTREF(__pyx_t_6);
20615  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
20616  __Pyx_GOTREF(__pyx_t_7);
20617  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20618  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20619  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20620  __PYX_ERR(1, 14, __pyx_L1_error)
20621  }
20622  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
20623  __Pyx_GOTREF(__pyx_t_6);
20624  __pyx_t_8 = NULL;
20625  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
20626  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
20627  if (likely(__pyx_t_8)) {
20628  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
20629  __Pyx_INCREF(__pyx_t_8);
20630  __Pyx_INCREF(function);
20631  __Pyx_DECREF_SET(__pyx_t_7, function);
20632  }
20633  }
20634  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
20635  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
20636  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20637  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
20638  __Pyx_GOTREF(__pyx_t_1);
20639  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20640  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20641 
20642  /* "(tree fragment)":13
20643  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20644  * __pyx_result.name = __pyx_state[0]
20645  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
20646  * __pyx_result.__dict__.update(__pyx_state[1])
20647  */
20648  }
20649 
20650  /* "(tree fragment)":11
20651  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20652  * return __pyx_result
20653  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
20654  * __pyx_result.name = __pyx_state[0]
20655  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20656  */
20657 
20658  /* function exit code */
20659  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20660  goto __pyx_L0;
20661  __pyx_L1_error:;
20662  __Pyx_XDECREF(__pyx_t_1);
20663  __Pyx_XDECREF(__pyx_t_6);
20664  __Pyx_XDECREF(__pyx_t_7);
20665  __Pyx_XDECREF(__pyx_t_8);
20666  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
20667  __pyx_r = 0;
20668  __pyx_L0:;
20669  __Pyx_XGIVEREF(__pyx_r);
20670  __Pyx_RefNannyFinishContext();
20671  return __pyx_r;
20672 }
20673 
20674 static PyObject *__pyx_tp_new_15superluWrappers_cSparseMatrix(PyTypeObject *t, PyObject *a, PyObject *k) {
20675  PyObject *o;
20676  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20677  o = (*t->tp_alloc)(t, 0);
20678  } else {
20679  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20680  }
20681  if (unlikely(!o)) return 0;
20682  if (unlikely(__pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(o, a, k) < 0)) goto bad;
20683  return o;
20684  bad:
20685  Py_DECREF(o); o = 0;
20686  return NULL;
20687 }
20688 
20689 static void __pyx_tp_dealloc_15superluWrappers_cSparseMatrix(PyObject *o) {
20690  #if CYTHON_USE_TP_FINALIZE
20691  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
20692  if (PyObject_CallFinalizerFromDealloc(o)) return;
20693  }
20694  #endif
20695  (*Py_TYPE(o)->tp_free)(o);
20696 }
20697 
20698 static PyMethodDef __pyx_methods_15superluWrappers_cSparseMatrix[] = {
20699  {"__reduce_cython__", (PyCFunction)__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__, METH_NOARGS, 0},
20700  {"__setstate_cython__", (PyCFunction)__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__, METH_O, 0},
20701  {0, 0, 0, 0}
20702 };
20703 
20704 static PyTypeObject __pyx_type_15superluWrappers_cSparseMatrix = {
20705  PyVarObject_HEAD_INIT(0, 0)
20706  "superluWrappers.cSparseMatrix", /*tp_name*/
20707  sizeof(struct __pyx_obj_15superluWrappers_cSparseMatrix), /*tp_basicsize*/
20708  0, /*tp_itemsize*/
20709  __pyx_tp_dealloc_15superluWrappers_cSparseMatrix, /*tp_dealloc*/
20710  #if PY_VERSION_HEX < 0x030800b4
20711  0, /*tp_print*/
20712  #endif
20713  #if PY_VERSION_HEX >= 0x030800b4
20714  0, /*tp_vectorcall_offset*/
20715  #endif
20716  0, /*tp_getattr*/
20717  0, /*tp_setattr*/
20718  #if PY_MAJOR_VERSION < 3
20719  0, /*tp_compare*/
20720  #endif
20721  #if PY_MAJOR_VERSION >= 3
20722  0, /*tp_as_async*/
20723  #endif
20724  0, /*tp_repr*/
20725  0, /*tp_as_number*/
20726  0, /*tp_as_sequence*/
20727  0, /*tp_as_mapping*/
20728  0, /*tp_hash*/
20729  0, /*tp_call*/
20730  0, /*tp_str*/
20731  0, /*tp_getattro*/
20732  0, /*tp_setattro*/
20733  0, /*tp_as_buffer*/
20734  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
20735  0, /*tp_doc*/
20736  0, /*tp_traverse*/
20737  0, /*tp_clear*/
20738  0, /*tp_richcompare*/
20739  0, /*tp_weaklistoffset*/
20740  0, /*tp_iter*/
20741  0, /*tp_iternext*/
20742  __pyx_methods_15superluWrappers_cSparseMatrix, /*tp_methods*/
20743  0, /*tp_members*/
20744  0, /*tp_getset*/
20745  0, /*tp_base*/
20746  0, /*tp_dict*/
20747  0, /*tp_descr_get*/
20748  0, /*tp_descr_set*/
20749  0, /*tp_dictoffset*/
20750  0, /*tp_init*/
20751  0, /*tp_alloc*/
20752  __pyx_tp_new_15superluWrappers_cSparseMatrix, /*tp_new*/
20753  0, /*tp_free*/
20754  0, /*tp_is_gc*/
20755  0, /*tp_bases*/
20756  0, /*tp_mro*/
20757  0, /*tp_cache*/
20758  0, /*tp_subclasses*/
20759  0, /*tp_weaklist*/
20760  0, /*tp_del*/
20761  0, /*tp_version_tag*/
20762  #if PY_VERSION_HEX >= 0x030400a1
20763  0, /*tp_finalize*/
20764  #endif
20765  #if PY_VERSION_HEX >= 0x030800b1
20766  0, /*tp_vectorcall*/
20767  #endif
20768  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20769  0, /*tp_print*/
20770  #endif
20771 };
20772 static struct __pyx_vtabstruct_15superluWrappers_SparseFactor __pyx_vtable_15superluWrappers_SparseFactor;
20773 
20774 static PyObject *__pyx_tp_new_15superluWrappers_SparseFactor(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20775  struct __pyx_obj_15superluWrappers_SparseFactor *p;
20776  PyObject *o;
20777  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20778  o = (*t->tp_alloc)(t, 0);
20779  } else {
20780  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20781  }
20782  if (unlikely(!o)) return 0;
20783  p = ((struct __pyx_obj_15superluWrappers_SparseFactor *)o);
20784  p->__pyx_vtab = __pyx_vtabptr_15superluWrappers_SparseFactor;
20785  return o;
20786 }
20787 
20788 static void __pyx_tp_dealloc_15superluWrappers_SparseFactor(PyObject *o) {
20789  #if CYTHON_USE_TP_FINALIZE
20790  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
20791  if (PyObject_CallFinalizerFromDealloc(o)) return;
20792  }
20793  #endif
20794  (*Py_TYPE(o)->tp_free)(o);
20795 }
20796 
20797 static PyObject *__pyx_getprop_15superluWrappers_12SparseFactor_dim(PyObject *o, CYTHON_UNUSED void *x) {
20798  return __pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(o);
20799 }
20800 
20801 static int __pyx_setprop_15superluWrappers_12SparseFactor_dim(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
20802  if (v) {
20803  return __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(o, v);
20804  }
20805  else {
20806  PyErr_SetString(PyExc_NotImplementedError, "__del__");
20807  return -1;
20808  }
20809 }
20810 
20811 static PyMethodDef __pyx_methods_15superluWrappers_SparseFactor[] = {
20812  {"__reduce_cython__", (PyCFunction)__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__, METH_NOARGS, 0},
20813  {"__setstate_cython__", (PyCFunction)__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__, METH_O, 0},
20814  {0, 0, 0, 0}
20815 };
20816 
20817 static struct PyGetSetDef __pyx_getsets_15superluWrappers_SparseFactor[] = {
20818  {(char *)"dim", __pyx_getprop_15superluWrappers_12SparseFactor_dim, __pyx_setprop_15superluWrappers_12SparseFactor_dim, (char *)0, 0},
20819  {0, 0, 0, 0, 0}
20820 };
20821 
20822 static PyTypeObject __pyx_type_15superluWrappers_SparseFactor = {
20823  PyVarObject_HEAD_INIT(0, 0)
20824  "superluWrappers.SparseFactor", /*tp_name*/
20825  sizeof(struct __pyx_obj_15superluWrappers_SparseFactor), /*tp_basicsize*/
20826  0, /*tp_itemsize*/
20827  __pyx_tp_dealloc_15superluWrappers_SparseFactor, /*tp_dealloc*/
20828  #if PY_VERSION_HEX < 0x030800b4
20829  0, /*tp_print*/
20830  #endif
20831  #if PY_VERSION_HEX >= 0x030800b4
20832  0, /*tp_vectorcall_offset*/
20833  #endif
20834  0, /*tp_getattr*/
20835  0, /*tp_setattr*/
20836  #if PY_MAJOR_VERSION < 3
20837  0, /*tp_compare*/
20838  #endif
20839  #if PY_MAJOR_VERSION >= 3
20840  0, /*tp_as_async*/
20841  #endif
20842  0, /*tp_repr*/
20843  0, /*tp_as_number*/
20844  0, /*tp_as_sequence*/
20845  0, /*tp_as_mapping*/
20846  0, /*tp_hash*/
20847  0, /*tp_call*/
20848  0, /*tp_str*/
20849  0, /*tp_getattro*/
20850  0, /*tp_setattro*/
20851  0, /*tp_as_buffer*/
20852  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
20853  0, /*tp_doc*/
20854  0, /*tp_traverse*/
20855  0, /*tp_clear*/
20856  0, /*tp_richcompare*/
20857  0, /*tp_weaklistoffset*/
20858  0, /*tp_iter*/
20859  0, /*tp_iternext*/
20860  __pyx_methods_15superluWrappers_SparseFactor, /*tp_methods*/
20861  0, /*tp_members*/
20862  __pyx_getsets_15superluWrappers_SparseFactor, /*tp_getset*/
20863  0, /*tp_base*/
20864  0, /*tp_dict*/
20865  0, /*tp_descr_get*/
20866  0, /*tp_descr_set*/
20867  0, /*tp_dictoffset*/
20868  __pyx_pw_15superluWrappers_12SparseFactor_1__init__, /*tp_init*/
20869  0, /*tp_alloc*/
20870  __pyx_tp_new_15superluWrappers_SparseFactor, /*tp_new*/
20871  0, /*tp_free*/
20872  0, /*tp_is_gc*/
20873  0, /*tp_bases*/
20874  0, /*tp_mro*/
20875  0, /*tp_cache*/
20876  0, /*tp_subclasses*/
20877  0, /*tp_weaklist*/
20878  0, /*tp_del*/
20879  0, /*tp_version_tag*/
20880  #if PY_VERSION_HEX >= 0x030400a1
20881  0, /*tp_finalize*/
20882  #endif
20883  #if PY_VERSION_HEX >= 0x030800b1
20884  0, /*tp_vectorcall*/
20885  #endif
20886  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20887  0, /*tp_print*/
20888  #endif
20889 };
20890 static struct __pyx_vtabstruct_array __pyx_vtable_array;
20891 
20892 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
20893  struct __pyx_array_obj *p;
20894  PyObject *o;
20895  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20896  o = (*t->tp_alloc)(t, 0);
20897  } else {
20898  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20899  }
20900  if (unlikely(!o)) return 0;
20901  p = ((struct __pyx_array_obj *)o);
20902  p->__pyx_vtab = __pyx_vtabptr_array;
20903  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
20904  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
20905  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
20906  return o;
20907  bad:
20908  Py_DECREF(o); o = 0;
20909  return NULL;
20910 }
20911 
20912 static void __pyx_tp_dealloc_array(PyObject *o) {
20913  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
20914  #if CYTHON_USE_TP_FINALIZE
20915  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
20916  if (PyObject_CallFinalizerFromDealloc(o)) return;
20917  }
20918  #endif
20919  {
20920  PyObject *etype, *eval, *etb;
20921  PyErr_Fetch(&etype, &eval, &etb);
20922  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20923  __pyx_array___dealloc__(o);
20924  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20925  PyErr_Restore(etype, eval, etb);
20926  }
20927  Py_CLEAR(p->mode);
20928  Py_CLEAR(p->_format);
20929  (*Py_TYPE(o)->tp_free)(o);
20930 }
20931 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
20932  PyObject *r;
20933  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
20934  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
20935  Py_DECREF(x);
20936  return r;
20937 }
20938 
20939 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
20940  if (v) {
20941  return __pyx_array___setitem__(o, i, v);
20942  }
20943  else {
20944  PyErr_Format(PyExc_NotImplementedError,
20945  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
20946  return -1;
20947  }
20948 }
20949 
20950 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
20951  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
20952  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
20953  PyErr_Clear();
20954  v = __pyx_array___getattr__(o, n);
20955  }
20956  return v;
20957 }
20958 
20959 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
20960  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
20961 }
20962 
20963 static PyMethodDef __pyx_methods_array[] = {
20964  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
20965  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
20966  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
20967  {0, 0, 0, 0}
20968 };
20969 
20970 static struct PyGetSetDef __pyx_getsets_array[] = {
20971  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
20972  {0, 0, 0, 0, 0}
20973 };
20974 
20975 static PySequenceMethods __pyx_tp_as_sequence_array = {
20976  __pyx_array___len__, /*sq_length*/
20977  0, /*sq_concat*/
20978  0, /*sq_repeat*/
20979  __pyx_sq_item_array, /*sq_item*/
20980  0, /*sq_slice*/
20981  0, /*sq_ass_item*/
20982  0, /*sq_ass_slice*/
20983  0, /*sq_contains*/
20984  0, /*sq_inplace_concat*/
20985  0, /*sq_inplace_repeat*/
20986 };
20987 
20988 static PyMappingMethods __pyx_tp_as_mapping_array = {
20989  __pyx_array___len__, /*mp_length*/
20990  __pyx_array___getitem__, /*mp_subscript*/
20991  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
20992 };
20993 
20994 static PyBufferProcs __pyx_tp_as_buffer_array = {
20995  #if PY_MAJOR_VERSION < 3
20996  0, /*bf_getreadbuffer*/
20997  #endif
20998  #if PY_MAJOR_VERSION < 3
20999  0, /*bf_getwritebuffer*/
21000  #endif
21001  #if PY_MAJOR_VERSION < 3
21002  0, /*bf_getsegcount*/
21003  #endif
21004  #if PY_MAJOR_VERSION < 3
21005  0, /*bf_getcharbuffer*/
21006  #endif
21007  __pyx_array_getbuffer, /*bf_getbuffer*/
21008  0, /*bf_releasebuffer*/
21009 };
21010 
21011 static PyTypeObject __pyx_type___pyx_array = {
21012  PyVarObject_HEAD_INIT(0, 0)
21013  "superluWrappers.array", /*tp_name*/
21014  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
21015  0, /*tp_itemsize*/
21016  __pyx_tp_dealloc_array, /*tp_dealloc*/
21017  #if PY_VERSION_HEX < 0x030800b4
21018  0, /*tp_print*/
21019  #endif
21020  #if PY_VERSION_HEX >= 0x030800b4
21021  0, /*tp_vectorcall_offset*/
21022  #endif
21023  0, /*tp_getattr*/
21024  0, /*tp_setattr*/
21025  #if PY_MAJOR_VERSION < 3
21026  0, /*tp_compare*/
21027  #endif
21028  #if PY_MAJOR_VERSION >= 3
21029  0, /*tp_as_async*/
21030  #endif
21031  0, /*tp_repr*/
21032  0, /*tp_as_number*/
21033  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
21034  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
21035  0, /*tp_hash*/
21036  0, /*tp_call*/
21037  0, /*tp_str*/
21038  __pyx_tp_getattro_array, /*tp_getattro*/
21039  0, /*tp_setattro*/
21040  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
21041  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21042  0, /*tp_doc*/
21043  0, /*tp_traverse*/
21044  0, /*tp_clear*/
21045  0, /*tp_richcompare*/
21046  0, /*tp_weaklistoffset*/
21047  0, /*tp_iter*/
21048  0, /*tp_iternext*/
21049  __pyx_methods_array, /*tp_methods*/
21050  0, /*tp_members*/
21051  __pyx_getsets_array, /*tp_getset*/
21052  0, /*tp_base*/
21053  0, /*tp_dict*/
21054  0, /*tp_descr_get*/
21055  0, /*tp_descr_set*/
21056  0, /*tp_dictoffset*/
21057  0, /*tp_init*/
21058  0, /*tp_alloc*/
21059  __pyx_tp_new_array, /*tp_new*/
21060  0, /*tp_free*/
21061  0, /*tp_is_gc*/
21062  0, /*tp_bases*/
21063  0, /*tp_mro*/
21064  0, /*tp_cache*/
21065  0, /*tp_subclasses*/
21066  0, /*tp_weaklist*/
21067  0, /*tp_del*/
21068  0, /*tp_version_tag*/
21069  #if PY_VERSION_HEX >= 0x030400a1
21070  0, /*tp_finalize*/
21071  #endif
21072  #if PY_VERSION_HEX >= 0x030800b1
21073  0, /*tp_vectorcall*/
21074  #endif
21075  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21076  0, /*tp_print*/
21077  #endif
21078 };
21079 
21080 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21081  struct __pyx_MemviewEnum_obj *p;
21082  PyObject *o;
21083  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21084  o = (*t->tp_alloc)(t, 0);
21085  } else {
21086  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21087  }
21088  if (unlikely(!o)) return 0;
21089  p = ((struct __pyx_MemviewEnum_obj *)o);
21090  p->name = Py_None; Py_INCREF(Py_None);
21091  return o;
21092 }
21093 
21094 static void __pyx_tp_dealloc_Enum(PyObject *o) {
21095  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21096  #if CYTHON_USE_TP_FINALIZE
21097  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21098  if (PyObject_CallFinalizerFromDealloc(o)) return;
21099  }
21100  #endif
21101  PyObject_GC_UnTrack(o);
21102  Py_CLEAR(p->name);
21103  (*Py_TYPE(o)->tp_free)(o);
21104 }
21105 
21106 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
21107  int e;
21108  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21109  if (p->name) {
21110  e = (*v)(p->name, a); if (e) return e;
21111  }
21112  return 0;
21113 }
21114 
21115 static int __pyx_tp_clear_Enum(PyObject *o) {
21116  PyObject* tmp;
21117  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21118  tmp = ((PyObject*)p->name);
21119  p->name = Py_None; Py_INCREF(Py_None);
21120  Py_XDECREF(tmp);
21121  return 0;
21122 }
21123 
21124 static PyMethodDef __pyx_methods_Enum[] = {
21125  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
21126  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
21127  {0, 0, 0, 0}
21128 };
21129 
21130 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
21131  PyVarObject_HEAD_INIT(0, 0)
21132  "superluWrappers.Enum", /*tp_name*/
21133  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
21134  0, /*tp_itemsize*/
21135  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
21136  #if PY_VERSION_HEX < 0x030800b4
21137  0, /*tp_print*/
21138  #endif
21139  #if PY_VERSION_HEX >= 0x030800b4
21140  0, /*tp_vectorcall_offset*/
21141  #endif
21142  0, /*tp_getattr*/
21143  0, /*tp_setattr*/
21144  #if PY_MAJOR_VERSION < 3
21145  0, /*tp_compare*/
21146  #endif
21147  #if PY_MAJOR_VERSION >= 3
21148  0, /*tp_as_async*/
21149  #endif
21150  __pyx_MemviewEnum___repr__, /*tp_repr*/
21151  0, /*tp_as_number*/
21152  0, /*tp_as_sequence*/
21153  0, /*tp_as_mapping*/
21154  0, /*tp_hash*/
21155  0, /*tp_call*/
21156  0, /*tp_str*/
21157  0, /*tp_getattro*/
21158  0, /*tp_setattro*/
21159  0, /*tp_as_buffer*/
21160  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21161  0, /*tp_doc*/
21162  __pyx_tp_traverse_Enum, /*tp_traverse*/
21163  __pyx_tp_clear_Enum, /*tp_clear*/
21164  0, /*tp_richcompare*/
21165  0, /*tp_weaklistoffset*/
21166  0, /*tp_iter*/
21167  0, /*tp_iternext*/
21168  __pyx_methods_Enum, /*tp_methods*/
21169  0, /*tp_members*/
21170  0, /*tp_getset*/
21171  0, /*tp_base*/
21172  0, /*tp_dict*/
21173  0, /*tp_descr_get*/
21174  0, /*tp_descr_set*/
21175  0, /*tp_dictoffset*/
21176  __pyx_MemviewEnum___init__, /*tp_init*/
21177  0, /*tp_alloc*/
21178  __pyx_tp_new_Enum, /*tp_new*/
21179  0, /*tp_free*/
21180  0, /*tp_is_gc*/
21181  0, /*tp_bases*/
21182  0, /*tp_mro*/
21183  0, /*tp_cache*/
21184  0, /*tp_subclasses*/
21185  0, /*tp_weaklist*/
21186  0, /*tp_del*/
21187  0, /*tp_version_tag*/
21188  #if PY_VERSION_HEX >= 0x030400a1
21189  0, /*tp_finalize*/
21190  #endif
21191  #if PY_VERSION_HEX >= 0x030800b1
21192  0, /*tp_vectorcall*/
21193  #endif
21194  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21195  0, /*tp_print*/
21196  #endif
21197 };
21198 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
21199 
21200 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
21201  struct __pyx_memoryview_obj *p;
21202  PyObject *o;
21203  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21204  o = (*t->tp_alloc)(t, 0);
21205  } else {
21206  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21207  }
21208  if (unlikely(!o)) return 0;
21209  p = ((struct __pyx_memoryview_obj *)o);
21210  p->__pyx_vtab = __pyx_vtabptr_memoryview;
21211  p->obj = Py_None; Py_INCREF(Py_None);
21212  p->_size = Py_None; Py_INCREF(Py_None);
21213  p->_array_interface = Py_None; Py_INCREF(Py_None);
21214  p->view.obj = NULL;
21215  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
21216  return o;
21217  bad:
21218  Py_DECREF(o); o = 0;
21219  return NULL;
21220 }
21221 
21222 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
21223  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21224  #if CYTHON_USE_TP_FINALIZE
21225  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21226  if (PyObject_CallFinalizerFromDealloc(o)) return;
21227  }
21228  #endif
21229  PyObject_GC_UnTrack(o);
21230  {
21231  PyObject *etype, *eval, *etb;
21232  PyErr_Fetch(&etype, &eval, &etb);
21233  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21234  __pyx_memoryview___dealloc__(o);
21235  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21236  PyErr_Restore(etype, eval, etb);
21237  }
21238  Py_CLEAR(p->obj);
21239  Py_CLEAR(p->_size);
21240  Py_CLEAR(p->_array_interface);
21241  (*Py_TYPE(o)->tp_free)(o);
21242 }
21243 
21244 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
21245  int e;
21246  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21247  if (p->obj) {
21248  e = (*v)(p->obj, a); if (e) return e;
21249  }
21250  if (p->_size) {
21251  e = (*v)(p->_size, a); if (e) return e;
21252  }
21253  if (p->_array_interface) {
21254  e = (*v)(p->_array_interface, a); if (e) return e;
21255  }
21256  if (p->view.obj) {
21257  e = (*v)(p->view.obj, a); if (e) return e;
21258  }
21259  return 0;
21260 }
21261 
21262 static int __pyx_tp_clear_memoryview(PyObject *o) {
21263  PyObject* tmp;
21264  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21265  tmp = ((PyObject*)p->obj);
21266  p->obj = Py_None; Py_INCREF(Py_None);
21267  Py_XDECREF(tmp);
21268  tmp = ((PyObject*)p->_size);
21269  p->_size = Py_None; Py_INCREF(Py_None);
21270  Py_XDECREF(tmp);
21271  tmp = ((PyObject*)p->_array_interface);
21272  p->_array_interface = Py_None; Py_INCREF(Py_None);
21273  Py_XDECREF(tmp);
21274  Py_CLEAR(p->view.obj);
21275  return 0;
21276 }
21277 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
21278  PyObject *r;
21279  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21280  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21281  Py_DECREF(x);
21282  return r;
21283 }
21284 
21285 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
21286  if (v) {
21287  return __pyx_memoryview___setitem__(o, i, v);
21288  }
21289  else {
21290  PyErr_Format(PyExc_NotImplementedError,
21291  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21292  return -1;
21293  }
21294 }
21295 
21296 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
21297  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
21298 }
21299 
21300 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
21301  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
21302 }
21303 
21304 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
21305  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
21306 }
21307 
21308 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
21309  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
21310 }
21311 
21312 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
21313  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
21314 }
21315 
21316 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
21317  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
21318 }
21319 
21320 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
21321  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
21322 }
21323 
21324 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
21325  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
21326 }
21327 
21328 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
21329  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
21330 }
21331 
21332 static PyMethodDef __pyx_methods_memoryview[] = {
21333  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
21334  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
21335  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
21336  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
21337  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
21338  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
21339  {0, 0, 0, 0}
21340 };
21341 
21342 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
21343  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
21344  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
21345  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
21346  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
21347  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
21348  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
21349  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
21350  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
21351  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
21352  {0, 0, 0, 0, 0}
21353 };
21354 
21355 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
21356  __pyx_memoryview___len__, /*sq_length*/
21357  0, /*sq_concat*/
21358  0, /*sq_repeat*/
21359  __pyx_sq_item_memoryview, /*sq_item*/
21360  0, /*sq_slice*/
21361  0, /*sq_ass_item*/
21362  0, /*sq_ass_slice*/
21363  0, /*sq_contains*/
21364  0, /*sq_inplace_concat*/
21365  0, /*sq_inplace_repeat*/
21366 };
21367 
21368 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
21369  __pyx_memoryview___len__, /*mp_length*/
21370  __pyx_memoryview___getitem__, /*mp_subscript*/
21371  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
21372 };
21373 
21374 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
21375  #if PY_MAJOR_VERSION < 3
21376  0, /*bf_getreadbuffer*/
21377  #endif
21378  #if PY_MAJOR_VERSION < 3
21379  0, /*bf_getwritebuffer*/
21380  #endif
21381  #if PY_MAJOR_VERSION < 3
21382  0, /*bf_getsegcount*/
21383  #endif
21384  #if PY_MAJOR_VERSION < 3
21385  0, /*bf_getcharbuffer*/
21386  #endif
21387  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
21388  0, /*bf_releasebuffer*/
21389 };
21390 
21391 static PyTypeObject __pyx_type___pyx_memoryview = {
21392  PyVarObject_HEAD_INIT(0, 0)
21393  "superluWrappers.memoryview", /*tp_name*/
21394  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
21395  0, /*tp_itemsize*/
21396  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
21397  #if PY_VERSION_HEX < 0x030800b4
21398  0, /*tp_print*/
21399  #endif
21400  #if PY_VERSION_HEX >= 0x030800b4
21401  0, /*tp_vectorcall_offset*/
21402  #endif
21403  0, /*tp_getattr*/
21404  0, /*tp_setattr*/
21405  #if PY_MAJOR_VERSION < 3
21406  0, /*tp_compare*/
21407  #endif
21408  #if PY_MAJOR_VERSION >= 3
21409  0, /*tp_as_async*/
21410  #endif
21411  __pyx_memoryview___repr__, /*tp_repr*/
21412  0, /*tp_as_number*/
21413  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
21414  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
21415  0, /*tp_hash*/
21416  0, /*tp_call*/
21417  __pyx_memoryview___str__, /*tp_str*/
21418  0, /*tp_getattro*/
21419  0, /*tp_setattro*/
21420  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
21421  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21422  0, /*tp_doc*/
21423  __pyx_tp_traverse_memoryview, /*tp_traverse*/
21424  __pyx_tp_clear_memoryview, /*tp_clear*/
21425  0, /*tp_richcompare*/
21426  0, /*tp_weaklistoffset*/
21427  0, /*tp_iter*/
21428  0, /*tp_iternext*/
21429  __pyx_methods_memoryview, /*tp_methods*/
21430  0, /*tp_members*/
21431  __pyx_getsets_memoryview, /*tp_getset*/
21432  0, /*tp_base*/
21433  0, /*tp_dict*/
21434  0, /*tp_descr_get*/
21435  0, /*tp_descr_set*/
21436  0, /*tp_dictoffset*/
21437  0, /*tp_init*/
21438  0, /*tp_alloc*/
21439  __pyx_tp_new_memoryview, /*tp_new*/
21440  0, /*tp_free*/
21441  0, /*tp_is_gc*/
21442  0, /*tp_bases*/
21443  0, /*tp_mro*/
21444  0, /*tp_cache*/
21445  0, /*tp_subclasses*/
21446  0, /*tp_weaklist*/
21447  0, /*tp_del*/
21448  0, /*tp_version_tag*/
21449  #if PY_VERSION_HEX >= 0x030400a1
21450  0, /*tp_finalize*/
21451  #endif
21452  #if PY_VERSION_HEX >= 0x030800b1
21453  0, /*tp_vectorcall*/
21454  #endif
21455  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21456  0, /*tp_print*/
21457  #endif
21458 };
21459 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
21460 
21461 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
21462  struct __pyx_memoryviewslice_obj *p;
21463  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
21464  if (unlikely(!o)) return 0;
21465  p = ((struct __pyx_memoryviewslice_obj *)o);
21466  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
21467  p->from_object = Py_None; Py_INCREF(Py_None);
21468  p->from_slice.memview = NULL;
21469  return o;
21470 }
21471 
21472 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
21473  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21474  #if CYTHON_USE_TP_FINALIZE
21475  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21476  if (PyObject_CallFinalizerFromDealloc(o)) return;
21477  }
21478  #endif
21479  PyObject_GC_UnTrack(o);
21480  {
21481  PyObject *etype, *eval, *etb;
21482  PyErr_Fetch(&etype, &eval, &etb);
21483  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21484  __pyx_memoryviewslice___dealloc__(o);
21485  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21486  PyErr_Restore(etype, eval, etb);
21487  }
21488  Py_CLEAR(p->from_object);
21489  PyObject_GC_Track(o);
21490  __pyx_tp_dealloc_memoryview(o);
21491 }
21492 
21493 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
21494  int e;
21495  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21496  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
21497  if (p->from_object) {
21498  e = (*v)(p->from_object, a); if (e) return e;
21499  }
21500  return 0;
21501 }
21502 
21503 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
21504  PyObject* tmp;
21505  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21506  __pyx_tp_clear_memoryview(o);
21507  tmp = ((PyObject*)p->from_object);
21508  p->from_object = Py_None; Py_INCREF(Py_None);
21509  Py_XDECREF(tmp);
21510  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
21511  return 0;
21512 }
21513 
21514 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
21515  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
21516 }
21517 
21518 static PyMethodDef __pyx_methods__memoryviewslice[] = {
21519  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
21520  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
21521  {0, 0, 0, 0}
21522 };
21523 
21524 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
21525  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
21526  {0, 0, 0, 0, 0}
21527 };
21528 
21529 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
21530  PyVarObject_HEAD_INIT(0, 0)
21531  "superluWrappers._memoryviewslice", /*tp_name*/
21532  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
21533  0, /*tp_itemsize*/
21534  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
21535  #if PY_VERSION_HEX < 0x030800b4
21536  0, /*tp_print*/
21537  #endif
21538  #if PY_VERSION_HEX >= 0x030800b4
21539  0, /*tp_vectorcall_offset*/
21540  #endif
21541  0, /*tp_getattr*/
21542  0, /*tp_setattr*/
21543  #if PY_MAJOR_VERSION < 3
21544  0, /*tp_compare*/
21545  #endif
21546  #if PY_MAJOR_VERSION >= 3
21547  0, /*tp_as_async*/
21548  #endif
21549  #if CYTHON_COMPILING_IN_PYPY
21550  __pyx_memoryview___repr__, /*tp_repr*/
21551  #else
21552  0, /*tp_repr*/
21553  #endif
21554  0, /*tp_as_number*/
21555  0, /*tp_as_sequence*/
21556  0, /*tp_as_mapping*/
21557  0, /*tp_hash*/
21558  0, /*tp_call*/
21559  #if CYTHON_COMPILING_IN_PYPY
21560  __pyx_memoryview___str__, /*tp_str*/
21561  #else
21562  0, /*tp_str*/
21563  #endif
21564  0, /*tp_getattro*/
21565  0, /*tp_setattro*/
21566  0, /*tp_as_buffer*/
21567  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21568  "Internal class for passing memoryview slices to Python", /*tp_doc*/
21569  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
21570  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
21571  0, /*tp_richcompare*/
21572  0, /*tp_weaklistoffset*/
21573  0, /*tp_iter*/
21574  0, /*tp_iternext*/
21575  __pyx_methods__memoryviewslice, /*tp_methods*/
21576  0, /*tp_members*/
21577  __pyx_getsets__memoryviewslice, /*tp_getset*/
21578  0, /*tp_base*/
21579  0, /*tp_dict*/
21580  0, /*tp_descr_get*/
21581  0, /*tp_descr_set*/
21582  0, /*tp_dictoffset*/
21583  0, /*tp_init*/
21584  0, /*tp_alloc*/
21585  __pyx_tp_new__memoryviewslice, /*tp_new*/
21586  0, /*tp_free*/
21587  0, /*tp_is_gc*/
21588  0, /*tp_bases*/
21589  0, /*tp_mro*/
21590  0, /*tp_cache*/
21591  0, /*tp_subclasses*/
21592  0, /*tp_weaklist*/
21593  0, /*tp_del*/
21594  0, /*tp_version_tag*/
21595  #if PY_VERSION_HEX >= 0x030400a1
21596  0, /*tp_finalize*/
21597  #endif
21598  #if PY_VERSION_HEX >= 0x030800b1
21599  0, /*tp_vectorcall*/
21600  #endif
21601  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21602  0, /*tp_print*/
21603  #endif
21604 };
21605 
21606 static PyMethodDef __pyx_methods[] = {
21607  {0, 0, 0, 0}
21608 };
21609 
21610 #if PY_MAJOR_VERSION >= 3
21611 #if CYTHON_PEP489_MULTI_PHASE_INIT
21612 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
21613 static int __pyx_pymod_exec_superluWrappers(PyObject* module); /*proto*/
21614 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
21615  {Py_mod_create, (void*)__pyx_pymod_create},
21616  {Py_mod_exec, (void*)__pyx_pymod_exec_superluWrappers},
21617  {0, NULL}
21618 };
21619 #endif
21620 
21621 static struct PyModuleDef __pyx_moduledef = {
21622  PyModuleDef_HEAD_INIT,
21623  "superluWrappers",
21624  0, /* m_doc */
21625  #if CYTHON_PEP489_MULTI_PHASE_INIT
21626  0, /* m_size */
21627  #else
21628  -1, /* m_size */
21629  #endif
21630  __pyx_methods /* m_methods */,
21631  #if CYTHON_PEP489_MULTI_PHASE_INIT
21632  __pyx_moduledef_slots, /* m_slots */
21633  #else
21634  NULL, /* m_reload */
21635  #endif
21636  NULL, /* m_traverse */
21637  NULL, /* m_clear */
21638  NULL /* m_free */
21639 };
21640 #endif
21641 #ifndef CYTHON_SMALL_CODE
21642 #if defined(__clang__)
21643  #define CYTHON_SMALL_CODE
21644 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
21645  #define CYTHON_SMALL_CODE __attribute__((cold))
21646 #else
21647  #define CYTHON_SMALL_CODE
21648 #endif
21649 #endif
21650 
21651 static __Pyx_StringTabEntry __pyx_string_tab[] = {
21652  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
21653  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
21654  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
21655  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
21656  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
21657  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
21658  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
21659  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
21660  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
21661  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
21662  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
21663  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
21664  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
21665  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
21666  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
21667  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
21668  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
21669  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
21670  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
21671  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
21672  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
21673  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
21674  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
21675  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
21676  {&__pyx_n_s_SparseFactor, __pyx_k_SparseFactor, sizeof(__pyx_k_SparseFactor), 0, 0, 1, 1},
21677  {&__pyx_n_s_SparseMatrix, __pyx_k_SparseMatrix, sizeof(__pyx_k_SparseMatrix), 0, 0, 1, 1},
21678  {&__pyx_n_s_SparseMatrix___init, __pyx_k_SparseMatrix___init, sizeof(__pyx_k_SparseMatrix___init), 0, 0, 1, 1},
21679  {&__pyx_n_s_SparseMatrix_fwrite, __pyx_k_SparseMatrix_fwrite, sizeof(__pyx_k_SparseMatrix_fwrite), 0, 0, 1, 1},
21680  {&__pyx_n_s_SparseMatrix_getCSRrepresentatio, __pyx_k_SparseMatrix_getCSRrepresentatio, sizeof(__pyx_k_SparseMatrix_getCSRrepresentatio), 0, 0, 1, 1},
21681  {&__pyx_n_s_SparseMatrix_getSubMatCSRreprese, __pyx_k_SparseMatrix_getSubMatCSRreprese, sizeof(__pyx_k_SparseMatrix_getSubMatCSRreprese), 0, 0, 1, 1},
21682  {&__pyx_n_s_SparseMatrix_matvec, __pyx_k_SparseMatrix_matvec, sizeof(__pyx_k_SparseMatrix_matvec), 0, 0, 1, 1},
21683  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
21684  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
21685  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
21686  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
21687  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
21688  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
21689  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
21690  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
21691  {&__pyx_n_s_cSparseMatrix, __pyx_k_cSparseMatrix, sizeof(__pyx_k_cSparseMatrix), 0, 0, 1, 1},
21692  {&__pyx_n_s_cSparseMatrix_2, __pyx_k_cSparseMatrix_2, sizeof(__pyx_k_cSparseMatrix_2), 0, 0, 1, 1},
21693  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
21694  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
21695  {&__pyx_n_s_colind, __pyx_k_colind, sizeof(__pyx_k_colind), 0, 0, 1, 1},
21696  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
21697  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
21698  {&__pyx_kp_s_d_d_13_8e, __pyx_k_d_d_13_8e, sizeof(__pyx_k_d_d_13_8e), 0, 0, 1, 0},
21699  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
21700  {&__pyx_n_s_dim, __pyx_k_dim, sizeof(__pyx_k_dim), 0, 0, 1, 1},
21701  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
21702  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
21703  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
21704  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
21705  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
21706  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
21707  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
21708  {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1},
21709  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
21710  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
21711  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
21712  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
21713  {&__pyx_n_s_fwrite, __pyx_k_fwrite, sizeof(__pyx_k_fwrite), 0, 0, 1, 1},
21714  {&__pyx_n_s_getCSRrepresentation, __pyx_k_getCSRrepresentation, sizeof(__pyx_k_getCSRrepresentation), 0, 0, 1, 1},
21715  {&__pyx_n_s_getSubMatCSRrepresentation, __pyx_k_getSubMatCSRrepresentation, sizeof(__pyx_k_getSubMatCSRrepresentation), 0, 0, 1, 1},
21716  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
21717  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
21718  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
21719  {&__pyx_kp_s_i_i_i, __pyx_k_i_i_i, sizeof(__pyx_k_i_i_i), 0, 0, 1, 0},
21720  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
21721  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
21722  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
21723  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
21724  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
21725  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
21726  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
21727  {&__pyx_n_s_matvec, __pyx_k_matvec, sizeof(__pyx_k_matvec), 0, 0, 1, 1},
21728  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
21729  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
21730  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
21731  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
21732  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
21733  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
21734  {&__pyx_n_s_nc, __pyx_k_nc, sizeof(__pyx_k_nc), 0, 0, 1, 1},
21735  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
21736  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
21737  {&__pyx_n_s_nnz, __pyx_k_nnz, sizeof(__pyx_k_nnz), 0, 0, 1, 1},
21738  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
21739  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
21740  {&__pyx_n_s_nr, __pyx_k_nr, sizeof(__pyx_k_nr), 0, 0, 1, 1},
21741  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
21742  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
21743  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
21744  {&__pyx_n_s_nzval, __pyx_k_nzval, sizeof(__pyx_k_nzval), 0, 0, 1, 1},
21745  {&__pyx_n_s_nzvals, __pyx_k_nzvals, sizeof(__pyx_k_nzvals), 0, 0, 1, 1},
21746  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
21747  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
21748  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
21749  {&__pyx_n_s_output_file, __pyx_k_output_file, sizeof(__pyx_k_output_file), 0, 0, 1, 1},
21750  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
21751  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
21752  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
21753  {&__pyx_kp_s_proteus_superluWrappers_pyx, __pyx_k_proteus_superluWrappers_pyx, sizeof(__pyx_k_proteus_superluWrappers_pyx), 0, 0, 1, 0},
21754  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
21755  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
21756  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
21757  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
21758  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
21759  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
21760  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
21761  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
21762  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
21763  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
21764  {&__pyx_n_s_range_end, __pyx_k_range_end, sizeof(__pyx_k_range_end), 0, 0, 1, 1},
21765  {&__pyx_n_s_range_start, __pyx_k_range_start, sizeof(__pyx_k_range_start), 0, 0, 1, 1},
21766  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
21767  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
21768  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
21769  {&__pyx_n_s_rowptr, __pyx_k_rowptr, sizeof(__pyx_k_rowptr), 0, 0, 1, 1},
21770  {&__pyx_n_s_rows, __pyx_k_rows, sizeof(__pyx_k_rows), 0, 0, 1, 1},
21771  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
21772  {&__pyx_kp_s_self_A_self_AC_self_L_self_U_sel, __pyx_k_self_A_self_AC_self_L_self_U_sel, sizeof(__pyx_k_self_A_self_AC_self_L_self_U_sel), 0, 0, 1, 0},
21773  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
21774  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
21775  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
21776  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
21777  {&__pyx_n_s_sparseFactor, __pyx_k_sparseFactor, sizeof(__pyx_k_sparseFactor), 0, 0, 1, 1},
21778  {&__pyx_n_s_sparseFactorPrepare, __pyx_k_sparseFactorPrepare, sizeof(__pyx_k_sparseFactorPrepare), 0, 0, 1, 1},
21779  {&__pyx_n_s_sparseFactorSolve, __pyx_k_sparseFactorSolve, sizeof(__pyx_k_sparseFactorSolve), 0, 0, 1, 1},
21780  {&__pyx_n_s_sparse_matrix, __pyx_k_sparse_matrix, sizeof(__pyx_k_sparse_matrix), 0, 0, 1, 1},
21781  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
21782  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
21783  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
21784  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
21785  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
21786  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
21787  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
21788  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
21789  {&__pyx_n_s_superluWrappers, __pyx_k_superluWrappers, sizeof(__pyx_k_superluWrappers), 0, 0, 1, 1},
21790  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
21791  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
21792  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
21793  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
21794  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
21795  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
21796  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
21797  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
21798  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
21799  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
21800  {0, 0, 0, 0, 0, 0, 0}
21801 };
21802 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
21803  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 13, __pyx_L1_error)
21804  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 56, __pyx_L1_error)
21805  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 58, __pyx_L1_error)
21806  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
21807  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 777, __pyx_L1_error)
21808  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 781, __pyx_L1_error)
21809  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 959, __pyx_L1_error)
21810  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
21811  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
21812  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
21813  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
21814  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
21815  return 0;
21816  __pyx_L1_error:;
21817  return -1;
21818 }
21819 
21820 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
21821  __Pyx_RefNannyDeclarations
21822  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
21823 
21824  /* "superluWrappers.pyx":56
21825  * ?!Possibly something to do with parallel?!
21826  * """
21827  * with open(filename, 'w') as output_file: # <<<<<<<<<<<<<<
21828  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
21829  * for i in range(self.nr):
21830  */
21831  __pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 56, __pyx_L1_error)
21832  __Pyx_GOTREF(__pyx_tuple_);
21833  __Pyx_GIVEREF(__pyx_tuple_);
21834 
21835  /* "(tree fragment)":2
21836  * def __reduce_cython__(self):
21837  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21838  * def __setstate_cython__(self, __pyx_state):
21839  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21840  */
21841  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 2, __pyx_L1_error)
21842  __Pyx_GOTREF(__pyx_tuple__2);
21843  __Pyx_GIVEREF(__pyx_tuple__2);
21844 
21845  /* "(tree fragment)":4
21846  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21847  * def __setstate_cython__(self, __pyx_state):
21848  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21849  */
21850  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 4, __pyx_L1_error)
21851  __Pyx_GOTREF(__pyx_tuple__3);
21852  __Pyx_GIVEREF(__pyx_tuple__3);
21853 
21854  /* "(tree fragment)":2
21855  * def __reduce_cython__(self):
21856  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
21857  * def __setstate_cython__(self, __pyx_state):
21858  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
21859  */
21860  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_self_A_self_AC_self_L_self_U_sel); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 2, __pyx_L1_error)
21861  __Pyx_GOTREF(__pyx_tuple__4);
21862  __Pyx_GIVEREF(__pyx_tuple__4);
21863 
21864  /* "(tree fragment)":4
21865  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
21866  * def __setstate_cython__(self, __pyx_state):
21867  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
21868  */
21869  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_self_A_self_AC_self_L_self_U_sel); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 4, __pyx_L1_error)
21870  __Pyx_GOTREF(__pyx_tuple__5);
21871  __Pyx_GIVEREF(__pyx_tuple__5);
21872 
21873  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":777
21874  *
21875  * if (end - f) - <int>(new_offset - offset[0]) < 15:
21876  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
21877  *
21878  * if ((child.byteorder == c'>' and little_endian) or
21879  */
21880  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 777, __pyx_L1_error)
21881  __Pyx_GOTREF(__pyx_tuple__6);
21882  __Pyx_GIVEREF(__pyx_tuple__6);
21883 
21884  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":781
21885  * if ((child.byteorder == c'>' and little_endian) or
21886  * (child.byteorder == c'<' and not little_endian)):
21887  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
21888  * # One could encode it in the format string and have Cython
21889  * # complain instead, BUT: < and > in format strings also imply
21890  */
21891  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 781, __pyx_L1_error)
21892  __Pyx_GOTREF(__pyx_tuple__7);
21893  __Pyx_GIVEREF(__pyx_tuple__7);
21894 
21895  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":801
21896  * t = child.type_num
21897  * if end - f < 5:
21898  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
21899  *
21900  * # Until ticket #99 is fixed, use integers to avoid warnings
21901  */
21902  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 801, __pyx_L1_error)
21903  __Pyx_GOTREF(__pyx_tuple__8);
21904  __Pyx_GIVEREF(__pyx_tuple__8);
21905 
21906  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":959
21907  * __pyx_import_array()
21908  * except Exception:
21909  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
21910  *
21911  * cdef inline int import_umath() except -1:
21912  */
21913  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 959, __pyx_L1_error)
21914  __Pyx_GOTREF(__pyx_tuple__9);
21915  __Pyx_GIVEREF(__pyx_tuple__9);
21916 
21917  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":965
21918  * _import_umath()
21919  * except Exception:
21920  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
21921  *
21922  * cdef inline int import_ufunc() except -1:
21923  */
21924  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 965, __pyx_L1_error)
21925  __Pyx_GOTREF(__pyx_tuple__10);
21926  __Pyx_GIVEREF(__pyx_tuple__10);
21927 
21928  /* "View.MemoryView":133
21929  *
21930  * if not self.ndim:
21931  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
21932  *
21933  * if itemsize <= 0:
21934  */
21935  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 133, __pyx_L1_error)
21936  __Pyx_GOTREF(__pyx_tuple__11);
21937  __Pyx_GIVEREF(__pyx_tuple__11);
21938 
21939  /* "View.MemoryView":136
21940  *
21941  * if itemsize <= 0:
21942  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
21943  *
21944  * if not isinstance(format, bytes):
21945  */
21946  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 136, __pyx_L1_error)
21947  __Pyx_GOTREF(__pyx_tuple__12);
21948  __Pyx_GIVEREF(__pyx_tuple__12);
21949 
21950  /* "View.MemoryView":148
21951  *
21952  * if not self._shape:
21953  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
21954  *
21955  *
21956  */
21957  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 148, __pyx_L1_error)
21958  __Pyx_GOTREF(__pyx_tuple__13);
21959  __Pyx_GIVEREF(__pyx_tuple__13);
21960 
21961  /* "View.MemoryView":176
21962  * self.data = <char *>malloc(self.len)
21963  * if not self.data:
21964  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
21965  *
21966  * if self.dtype_is_object:
21967  */
21968  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 176, __pyx_L1_error)
21969  __Pyx_GOTREF(__pyx_tuple__14);
21970  __Pyx_GIVEREF(__pyx_tuple__14);
21971 
21972  /* "View.MemoryView":192
21973  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
21974  * if not (flags & bufmode):
21975  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
21976  * info.buf = self.data
21977  * info.len = self.len
21978  */
21979  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 192, __pyx_L1_error)
21980  __Pyx_GOTREF(__pyx_tuple__15);
21981  __Pyx_GIVEREF(__pyx_tuple__15);
21982 
21983  /* "(tree fragment)":2
21984  * def __reduce_cython__(self):
21985  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21986  * def __setstate_cython__(self, __pyx_state):
21987  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21988  */
21989  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 2, __pyx_L1_error)
21990  __Pyx_GOTREF(__pyx_tuple__16);
21991  __Pyx_GIVEREF(__pyx_tuple__16);
21992 
21993  /* "(tree fragment)":4
21994  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21995  * def __setstate_cython__(self, __pyx_state):
21996  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21997  */
21998  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 4, __pyx_L1_error)
21999  __Pyx_GOTREF(__pyx_tuple__17);
22000  __Pyx_GIVEREF(__pyx_tuple__17);
22001 
22002  /* "View.MemoryView":418
22003  * def __setitem__(memoryview self, object index, object value):
22004  * if self.view.readonly:
22005  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
22006  *
22007  * have_slices, index = _unellipsify(index, self.view.ndim)
22008  */
22009  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 418, __pyx_L1_error)
22010  __Pyx_GOTREF(__pyx_tuple__18);
22011  __Pyx_GIVEREF(__pyx_tuple__18);
22012 
22013  /* "View.MemoryView":495
22014  * result = struct.unpack(self.view.format, bytesitem)
22015  * except struct.error:
22016  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
22017  * else:
22018  * if len(self.view.format) == 1:
22019  */
22020  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 495, __pyx_L1_error)
22021  __Pyx_GOTREF(__pyx_tuple__19);
22022  __Pyx_GIVEREF(__pyx_tuple__19);
22023 
22024  /* "View.MemoryView":520
22025  * def __getbuffer__(self, Py_buffer *info, int flags):
22026  * if flags & PyBUF_WRITABLE and self.view.readonly:
22027  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
22028  *
22029  * if flags & PyBUF_ND:
22030  */
22031  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 520, __pyx_L1_error)
22032  __Pyx_GOTREF(__pyx_tuple__20);
22033  __Pyx_GIVEREF(__pyx_tuple__20);
22034 
22035  /* "View.MemoryView":570
22036  * if self.view.strides == NULL:
22037  *
22038  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
22039  *
22040  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
22041  */
22042  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 570, __pyx_L1_error)
22043  __Pyx_GOTREF(__pyx_tuple__21);
22044  __Pyx_GIVEREF(__pyx_tuple__21);
22045 
22046  /* "View.MemoryView":577
22047  * def suboffsets(self):
22048  * if self.view.suboffsets == NULL:
22049  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
22050  *
22051  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
22052  */
22053  __pyx_tuple__22 = PyTuple_New(1); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 577, __pyx_L1_error)
22054  __Pyx_GOTREF(__pyx_tuple__22);
22055  __Pyx_INCREF(__pyx_int_neg_1);
22056  __Pyx_GIVEREF(__pyx_int_neg_1);
22057  PyTuple_SET_ITEM(__pyx_tuple__22, 0, __pyx_int_neg_1);
22058  __Pyx_GIVEREF(__pyx_tuple__22);
22059 
22060  /* "(tree fragment)":2
22061  * def __reduce_cython__(self):
22062  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22063  * def __setstate_cython__(self, __pyx_state):
22064  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22065  */
22066  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 2, __pyx_L1_error)
22067  __Pyx_GOTREF(__pyx_tuple__23);
22068  __Pyx_GIVEREF(__pyx_tuple__23);
22069 
22070  /* "(tree fragment)":4
22071  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22072  * def __setstate_cython__(self, __pyx_state):
22073  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22074  */
22075  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 4, __pyx_L1_error)
22076  __Pyx_GOTREF(__pyx_tuple__24);
22077  __Pyx_GIVEREF(__pyx_tuple__24);
22078 
22079  /* "View.MemoryView":682
22080  * if item is Ellipsis:
22081  * if not seen_ellipsis:
22082  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
22083  * seen_ellipsis = True
22084  * else:
22085  */
22086  __pyx_slice__25 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__25)) __PYX_ERR(1, 682, __pyx_L1_error)
22087  __Pyx_GOTREF(__pyx_slice__25);
22088  __Pyx_GIVEREF(__pyx_slice__25);
22089 
22090  /* "View.MemoryView":703
22091  * for suboffset in suboffsets[:ndim]:
22092  * if suboffset >= 0:
22093  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
22094  *
22095  *
22096  */
22097  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 703, __pyx_L1_error)
22098  __Pyx_GOTREF(__pyx_tuple__26);
22099  __Pyx_GIVEREF(__pyx_tuple__26);
22100 
22101  /* "(tree fragment)":2
22102  * def __reduce_cython__(self):
22103  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22104  * def __setstate_cython__(self, __pyx_state):
22105  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22106  */
22107  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 2, __pyx_L1_error)
22108  __Pyx_GOTREF(__pyx_tuple__27);
22109  __Pyx_GIVEREF(__pyx_tuple__27);
22110 
22111  /* "(tree fragment)":4
22112  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22113  * def __setstate_cython__(self, __pyx_state):
22114  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22115  */
22116  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 4, __pyx_L1_error)
22117  __Pyx_GOTREF(__pyx_tuple__28);
22118  __Pyx_GIVEREF(__pyx_tuple__28);
22119 
22120  /* "superluWrappers.pyx":13
22121  * from libc.stdlib cimport malloc
22122  *
22123  * class SparseMatrix(object): # <<<<<<<<<<<<<<
22124  *
22125  * def __init__(self,
22126  */
22127  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 13, __pyx_L1_error)
22128  __Pyx_GOTREF(__pyx_tuple__29);
22129  __Pyx_GIVEREF(__pyx_tuple__29);
22130 
22131  /* "superluWrappers.pyx":15
22132  * class SparseMatrix(object):
22133  *
22134  * def __init__(self, # <<<<<<<<<<<<<<
22135  * nr,
22136  * nc,
22137  */
22138  __pyx_tuple__30 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_nr, __pyx_n_s_nc, __pyx_n_s_nnz, __pyx_n_s_nzvals, __pyx_n_s_colind, __pyx_n_s_rowptr); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 15, __pyx_L1_error)
22139  __Pyx_GOTREF(__pyx_tuple__30);
22140  __Pyx_GIVEREF(__pyx_tuple__30);
22141  __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_init, 15, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 15, __pyx_L1_error)
22142 
22143  /* "superluWrappers.pyx":35
22144  * self.rowptr)
22145  *
22146  * def matvec(self, x, y): # <<<<<<<<<<<<<<
22147  * """
22148  * Compute the sparse matrix-vector product y = Ax
22149  */
22150  __pyx_tuple__32 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 35, __pyx_L1_error)
22151  __Pyx_GOTREF(__pyx_tuple__32);
22152  __Pyx_GIVEREF(__pyx_tuple__32);
22153  __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_matvec, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 35, __pyx_L1_error)
22154 
22155  /* "superluWrappers.pyx":46
22156  * SparseMatrix_matvec(self._cSparseMatrix, x, y)
22157  *
22158  * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
22159  * """ Write the sparse matrix to a file
22160  *
22161  */
22162  __pyx_tuple__34 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_filename, __pyx_n_s_base, __pyx_n_s_output_file, __pyx_n_s_i, __pyx_n_s_k); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 46, __pyx_L1_error)
22163  __Pyx_GOTREF(__pyx_tuple__34);
22164  __Pyx_GIVEREF(__pyx_tuple__34);
22165  __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_fwrite, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 46, __pyx_L1_error)
22166 
22167  /* "superluWrappers.pyx":62
22168  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
22169  *
22170  * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
22171  * """ Get the CSR representation of the sparse matrix.
22172  *
22173  */
22174  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 62, __pyx_L1_error)
22175  __Pyx_GOTREF(__pyx_tuple__36);
22176  __Pyx_GIVEREF(__pyx_tuple__36);
22177  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_getCSRrepresentation, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 62, __pyx_L1_error)
22178 
22179  /* "superluWrappers.pyx":72
22180  * return (self.rowptr, self.colind, self.nzvals)
22181  *
22182  * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
22183  * range_start,
22184  * range_end):
22185  */
22186  __pyx_tuple__38 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_range_start, __pyx_n_s_range_end, __pyx_n_s_rows, __pyx_n_s_nnz, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_nzvals); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 72, __pyx_L1_error)
22187  __Pyx_GOTREF(__pyx_tuple__38);
22188  __Pyx_GIVEREF(__pyx_tuple__38);
22189  __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_getSubMatCSRrepresentation, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 72, __pyx_L1_error)
22190 
22191  /* "superluWrappers.pyx":219
22192  * self.X.Store = &self.storeX
22193  *
22194  * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
22195  * sparseFactor):
22196  * """ Python wrapper for superlu Sparse Factor Prepare function.
22197  */
22198  __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_sparse_matrix, __pyx_n_s_sparseFactor); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 219, __pyx_L1_error)
22199  __Pyx_GOTREF(__pyx_tuple__40);
22200  __Pyx_GIVEREF(__pyx_tuple__40);
22201  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_sparseFactorPrepare, 219, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 219, __pyx_L1_error)
22202 
22203  /* "superluWrappers.pyx":286
22204  * &info)
22205  *
22206  * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
22207  * x):
22208  * """ Sparse factor solve wrappers
22209  */
22210  __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_s_sparseFactor, __pyx_n_s_x); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 286, __pyx_L1_error)
22211  __Pyx_GOTREF(__pyx_tuple__42);
22212  __Pyx_GIVEREF(__pyx_tuple__42);
22213  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_sparseFactorSolve, 286, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 286, __pyx_L1_error)
22214 
22215  /* "View.MemoryView":286
22216  * return self.name
22217  *
22218  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
22219  * cdef strided = Enum("<strided and direct>") # default
22220  * cdef indirect = Enum("<strided and indirect>")
22221  */
22222  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 286, __pyx_L1_error)
22223  __Pyx_GOTREF(__pyx_tuple__44);
22224  __Pyx_GIVEREF(__pyx_tuple__44);
22225 
22226  /* "View.MemoryView":287
22227  *
22228  * cdef generic = Enum("<strided and direct or indirect>")
22229  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
22230  * cdef indirect = Enum("<strided and indirect>")
22231  *
22232  */
22233  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 287, __pyx_L1_error)
22234  __Pyx_GOTREF(__pyx_tuple__45);
22235  __Pyx_GIVEREF(__pyx_tuple__45);
22236 
22237  /* "View.MemoryView":288
22238  * cdef generic = Enum("<strided and direct or indirect>")
22239  * cdef strided = Enum("<strided and direct>") # default
22240  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
22241  *
22242  *
22243  */
22244  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 288, __pyx_L1_error)
22245  __Pyx_GOTREF(__pyx_tuple__46);
22246  __Pyx_GIVEREF(__pyx_tuple__46);
22247 
22248  /* "View.MemoryView":291
22249  *
22250  *
22251  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
22252  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
22253  *
22254  */
22255  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 291, __pyx_L1_error)
22256  __Pyx_GOTREF(__pyx_tuple__47);
22257  __Pyx_GIVEREF(__pyx_tuple__47);
22258 
22259  /* "View.MemoryView":292
22260  *
22261  * cdef contiguous = Enum("<contiguous and direct>")
22262  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
22263  *
22264  *
22265  */
22266  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 292, __pyx_L1_error)
22267  __Pyx_GOTREF(__pyx_tuple__48);
22268  __Pyx_GIVEREF(__pyx_tuple__48);
22269 
22270  /* "(tree fragment)":1
22271  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
22272  * cdef object __pyx_PickleError
22273  * cdef object __pyx_result
22274  */
22275  __pyx_tuple__49 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 1, __pyx_L1_error)
22276  __Pyx_GOTREF(__pyx_tuple__49);
22277  __Pyx_GIVEREF(__pyx_tuple__49);
22278  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(1, 1, __pyx_L1_error)
22279  __Pyx_RefNannyFinishContext();
22280  return 0;
22281  __pyx_L1_error:;
22282  __Pyx_RefNannyFinishContext();
22283  return -1;
22284 }
22285 
22286 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
22287  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
22288  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
22289  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22290  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
22291  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22292  return 0;
22293  __pyx_L1_error:;
22294  return -1;
22295 }
22296 
22297 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
22298 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
22299 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
22300 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
22301 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
22302 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
22303 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
22304 
22305 static int __Pyx_modinit_global_init_code(void) {
22306  __Pyx_RefNannyDeclarations
22307  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
22308  /*--- Global init code ---*/
22309  generic = Py_None; Py_INCREF(Py_None);
22310  strided = Py_None; Py_INCREF(Py_None);
22311  indirect = Py_None; Py_INCREF(Py_None);
22312  contiguous = Py_None; Py_INCREF(Py_None);
22313  indirect_contiguous = Py_None; Py_INCREF(Py_None);
22314  __Pyx_RefNannyFinishContext();
22315  return 0;
22316 }
22317 
22318 static int __Pyx_modinit_variable_export_code(void) {
22319  __Pyx_RefNannyDeclarations
22320  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
22321  /*--- Variable export code ---*/
22322  __Pyx_RefNannyFinishContext();
22323  return 0;
22324 }
22325 
22326 static int __Pyx_modinit_function_export_code(void) {
22327  __Pyx_RefNannyDeclarations
22328  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
22329  /*--- Function export code ---*/
22330  __Pyx_RefNannyFinishContext();
22331  return 0;
22332 }
22333 
22334 static int __Pyx_modinit_type_init_code(void) {
22335  __Pyx_RefNannyDeclarations
22336  int __pyx_lineno = 0;
22337  const char *__pyx_filename = NULL;
22338  int __pyx_clineno = 0;
22339  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
22340  /*--- Type init code ---*/
22341  if (PyType_Ready(&__pyx_type_15superluWrappers_cSparseMatrix) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
22342  #if PY_VERSION_HEX < 0x030800B1
22343  __pyx_type_15superluWrappers_cSparseMatrix.tp_print = 0;
22344  #endif
22345  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_15superluWrappers_cSparseMatrix.tp_dictoffset && __pyx_type_15superluWrappers_cSparseMatrix.tp_getattro == PyObject_GenericGetAttr)) {
22346  __pyx_type_15superluWrappers_cSparseMatrix.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22347  }
22348  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_cSparseMatrix_2, (PyObject *)&__pyx_type_15superluWrappers_cSparseMatrix) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
22349  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_15superluWrappers_cSparseMatrix) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
22350  __pyx_ptype_15superluWrappers_cSparseMatrix = &__pyx_type_15superluWrappers_cSparseMatrix;
22351  __pyx_vtabptr_15superluWrappers_SparseFactor = &__pyx_vtable_15superluWrappers_SparseFactor;
22352  __pyx_vtable_15superluWrappers_SparseFactor._set_mat_types = (PyObject *(*)(struct __pyx_obj_15superluWrappers_SparseFactor *))__pyx_f_15superluWrappers_12SparseFactor__set_mat_types;
22353  if (PyType_Ready(&__pyx_type_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
22354  #if PY_VERSION_HEX < 0x030800B1
22355  __pyx_type_15superluWrappers_SparseFactor.tp_print = 0;
22356  #endif
22357  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_15superluWrappers_SparseFactor.tp_dictoffset && __pyx_type_15superluWrappers_SparseFactor.tp_getattro == PyObject_GenericGetAttr)) {
22358  __pyx_type_15superluWrappers_SparseFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22359  }
22360  #if CYTHON_COMPILING_IN_CPYTHON
22361  {
22362  PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_15superluWrappers_SparseFactor, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 145, __pyx_L1_error)
22363  if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
22364  __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
22365  __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__.doc = __pyx_doc_15superluWrappers_12SparseFactor___init__;
22366  ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_15superluWrappers_12SparseFactor___init__;
22367  }
22368  }
22369  #endif
22370  if (__Pyx_SetVtable(__pyx_type_15superluWrappers_SparseFactor.tp_dict, __pyx_vtabptr_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
22371  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SparseFactor, (PyObject *)&__pyx_type_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
22372  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
22373  __pyx_ptype_15superluWrappers_SparseFactor = &__pyx_type_15superluWrappers_SparseFactor;
22374  __pyx_vtabptr_array = &__pyx_vtable_array;
22375  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
22376  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
22377  #if PY_VERSION_HEX < 0x030800B1
22378  __pyx_type___pyx_array.tp_print = 0;
22379  #endif
22380  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
22381  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
22382  __pyx_array_type = &__pyx_type___pyx_array;
22383  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
22384  #if PY_VERSION_HEX < 0x030800B1
22385  __pyx_type___pyx_MemviewEnum.tp_print = 0;
22386  #endif
22387  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
22388  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22389  }
22390  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
22391  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
22392  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
22393  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
22394  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
22395  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
22396  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
22397  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
22398  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
22399  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
22400  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
22401  #if PY_VERSION_HEX < 0x030800B1
22402  __pyx_type___pyx_memoryview.tp_print = 0;
22403  #endif
22404  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
22405  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22406  }
22407  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
22408  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
22409  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
22410  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
22411  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
22412  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
22413  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
22414  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
22415  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
22416  #if PY_VERSION_HEX < 0x030800B1
22417  __pyx_type___pyx_memoryviewslice.tp_print = 0;
22418  #endif
22419  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
22420  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22421  }
22422  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
22423  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
22424  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
22425  __Pyx_RefNannyFinishContext();
22426  return 0;
22427  __pyx_L1_error:;
22428  __Pyx_RefNannyFinishContext();
22429  return -1;
22430 }
22431 
22432 static int __Pyx_modinit_type_import_code(void) {
22433  __Pyx_RefNannyDeclarations
22434  PyObject *__pyx_t_1 = NULL;
22435  int __pyx_lineno = 0;
22436  const char *__pyx_filename = NULL;
22437  int __pyx_clineno = 0;
22438  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
22439  /*--- Type import code ---*/
22440  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
22441  __Pyx_GOTREF(__pyx_t_1);
22442  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
22443  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
22444  sizeof(PyTypeObject),
22445  #else
22446  sizeof(PyHeapTypeObject),
22447  #endif
22448  __Pyx_ImportType_CheckSize_Warn);
22449  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
22450  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22451  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __pyx_L1_error)
22452  __Pyx_GOTREF(__pyx_t_1);
22453  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
22454  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 207, __pyx_L1_error)
22455  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
22456  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 230, __pyx_L1_error)
22457  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
22458  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 234, __pyx_L1_error)
22459  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
22460  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 246, __pyx_L1_error)
22461  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
22462  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 839, __pyx_L1_error)
22463  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22464  __Pyx_RefNannyFinishContext();
22465  return 0;
22466  __pyx_L1_error:;
22467  __Pyx_XDECREF(__pyx_t_1);
22468  __Pyx_RefNannyFinishContext();
22469  return -1;
22470 }
22471 
22472 static int __Pyx_modinit_variable_import_code(void) {
22473  __Pyx_RefNannyDeclarations
22474  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
22475  /*--- Variable import code ---*/
22476  __Pyx_RefNannyFinishContext();
22477  return 0;
22478 }
22479 
22480 static int __Pyx_modinit_function_import_code(void) {
22481  __Pyx_RefNannyDeclarations
22482  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
22483  /*--- Function import code ---*/
22484  __Pyx_RefNannyFinishContext();
22485  return 0;
22486 }
22487 
22488 
22489 #ifndef CYTHON_NO_PYINIT_EXPORT
22490 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
22491 #elif PY_MAJOR_VERSION < 3
22492 #ifdef __cplusplus
22493 #define __Pyx_PyMODINIT_FUNC extern "C" void
22494 #else
22495 #define __Pyx_PyMODINIT_FUNC void
22496 #endif
22497 #else
22498 #ifdef __cplusplus
22499 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
22500 #else
22501 #define __Pyx_PyMODINIT_FUNC PyObject *
22502 #endif
22503 #endif
22504 
22505 
22506 #if PY_MAJOR_VERSION < 3
22507 __Pyx_PyMODINIT_FUNC initsuperluWrappers(void) CYTHON_SMALL_CODE; /*proto*/
22508 __Pyx_PyMODINIT_FUNC initsuperluWrappers(void)
22509 #else
22510 __Pyx_PyMODINIT_FUNC PyInit_superluWrappers(void) CYTHON_SMALL_CODE; /*proto*/
22511 __Pyx_PyMODINIT_FUNC PyInit_superluWrappers(void)
22512 #if CYTHON_PEP489_MULTI_PHASE_INIT
22513 {
22514  return PyModuleDef_Init(&__pyx_moduledef);
22515 }
22516 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
22517  #if PY_VERSION_HEX >= 0x030700A1
22518  static PY_INT64_T main_interpreter_id = -1;
22519  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
22520  if (main_interpreter_id == -1) {
22521  main_interpreter_id = current_id;
22522  return (unlikely(current_id == -1)) ? -1 : 0;
22523  } else if (unlikely(main_interpreter_id != current_id))
22524  #else
22525  static PyInterpreterState *main_interpreter = NULL;
22526  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
22527  if (!main_interpreter) {
22528  main_interpreter = current_interpreter;
22529  } else if (unlikely(main_interpreter != current_interpreter))
22530  #endif
22531  {
22532  PyErr_SetString(
22533  PyExc_ImportError,
22534  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
22535  return -1;
22536  }
22537  return 0;
22538 }
22539 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
22540  PyObject *value = PyObject_GetAttrString(spec, from_name);
22541  int result = 0;
22542  if (likely(value)) {
22543  if (allow_none || value != Py_None) {
22544  result = PyDict_SetItemString(moddict, to_name, value);
22545  }
22546  Py_DECREF(value);
22547  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
22548  PyErr_Clear();
22549  } else {
22550  result = -1;
22551  }
22552  return result;
22553 }
22554 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
22555  PyObject *module = NULL, *moddict, *modname;
22556  if (__Pyx_check_single_interpreter())
22557  return NULL;
22558  if (__pyx_m)
22559  return __Pyx_NewRef(__pyx_m);
22560  modname = PyObject_GetAttrString(spec, "name");
22561  if (unlikely(!modname)) goto bad;
22562  module = PyModule_NewObject(modname);
22563  Py_DECREF(modname);
22564  if (unlikely(!module)) goto bad;
22565  moddict = PyModule_GetDict(module);
22566  if (unlikely(!moddict)) goto bad;
22567  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
22568  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
22569  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
22570  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
22571  return module;
22572 bad:
22573  Py_XDECREF(module);
22574  return NULL;
22575 }
22576 
22577 
22578 static CYTHON_SMALL_CODE int __pyx_pymod_exec_superluWrappers(PyObject *__pyx_pyinit_module)
22579 #endif
22580 #endif
22581 {
22582  PyObject *__pyx_t_1 = NULL;
22583  PyObject *__pyx_t_2 = NULL;
22584  PyObject *__pyx_t_3 = NULL;
22585  static PyThread_type_lock __pyx_t_4[8];
22586  int __pyx_lineno = 0;
22587  const char *__pyx_filename = NULL;
22588  int __pyx_clineno = 0;
22589  __Pyx_RefNannyDeclarations
22590  #if CYTHON_PEP489_MULTI_PHASE_INIT
22591  if (__pyx_m) {
22592  if (__pyx_m == __pyx_pyinit_module) return 0;
22593  PyErr_SetString(PyExc_RuntimeError, "Module 'superluWrappers' has already been imported. Re-initialisation is not supported.");
22594  return -1;
22595  }
22596  #elif PY_MAJOR_VERSION >= 3
22597  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
22598  #endif
22599  #if CYTHON_REFNANNY
22600 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
22601 if (!__Pyx_RefNanny) {
22602  PyErr_Clear();
22603  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
22604  if (!__Pyx_RefNanny)
22605  Py_FatalError("failed to import 'refnanny' module");
22606 }
22607 #endif
22608  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_superluWrappers(void)", 0);
22609  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22610  #ifdef __Pxy_PyFrame_Initialize_Offsets
22611  __Pxy_PyFrame_Initialize_Offsets();
22612  #endif
22613  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
22614  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
22615  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
22616  #ifdef __Pyx_CyFunction_USED
22617  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22618  #endif
22619  #ifdef __Pyx_FusedFunction_USED
22620  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22621  #endif
22622  #ifdef __Pyx_Coroutine_USED
22623  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22624  #endif
22625  #ifdef __Pyx_Generator_USED
22626  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22627  #endif
22628  #ifdef __Pyx_AsyncGen_USED
22629  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22630  #endif
22631  #ifdef __Pyx_StopAsyncIteration_USED
22632  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22633  #endif
22634  /*--- Library function declarations ---*/
22635  /*--- Threads initialization code ---*/
22636  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
22637  #ifdef WITH_THREAD /* Python build with threading support? */
22638  PyEval_InitThreads();
22639  #endif
22640  #endif
22641  /*--- Module creation code ---*/
22642  #if CYTHON_PEP489_MULTI_PHASE_INIT
22643  __pyx_m = __pyx_pyinit_module;
22644  Py_INCREF(__pyx_m);
22645  #else
22646  #if PY_MAJOR_VERSION < 3
22647  __pyx_m = Py_InitModule4("superluWrappers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
22648  #else
22649  __pyx_m = PyModule_Create(&__pyx_moduledef);
22650  #endif
22651  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
22652  #endif
22653  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
22654  Py_INCREF(__pyx_d);
22655  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
22656  Py_INCREF(__pyx_b);
22657  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
22658  Py_INCREF(__pyx_cython_runtime);
22659  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
22660  /*--- Initialize various global constants etc. ---*/
22661  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22662  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
22663  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22664  #endif
22665  if (__pyx_module_is_main_superluWrappers) {
22666  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22667  }
22668  #if PY_MAJOR_VERSION >= 3
22669  {
22670  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
22671  if (!PyDict_GetItemString(modules, "superluWrappers")) {
22672  if (unlikely(PyDict_SetItemString(modules, "superluWrappers", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
22673  }
22674  }
22675  #endif
22676  /*--- Builtin init code ---*/
22677  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22678  /*--- Constants init code ---*/
22679  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22680  /*--- Global type/function init code ---*/
22681  (void)__Pyx_modinit_global_init_code();
22682  (void)__Pyx_modinit_variable_export_code();
22683  (void)__Pyx_modinit_function_export_code();
22684  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
22685  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
22686  (void)__Pyx_modinit_variable_import_code();
22687  (void)__Pyx_modinit_function_import_code();
22688  /*--- Execution code ---*/
22689  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
22690  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22691  #endif
22692 
22693  /* "superluWrappers.pyx":7
22694  * # correctly. perhaps they should only be enabled when not in debug mode?
22695  *
22696  * import numpy as np # <<<<<<<<<<<<<<
22697  * import cython
22698  * cimport numpy as np
22699  */
22700  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
22701  __Pyx_GOTREF(__pyx_t_1);
22702  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
22703  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22704 
22705  /* "superluWrappers.pyx":13
22706  * from libc.stdlib cimport malloc
22707  *
22708  * class SparseMatrix(object): # <<<<<<<<<<<<<<
22709  *
22710  * def __init__(self,
22711  */
22712  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__29); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
22713  __Pyx_GOTREF(__pyx_t_1);
22714  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__29, __pyx_n_s_SparseMatrix, __pyx_n_s_SparseMatrix, (PyObject *) NULL, __pyx_n_s_superluWrappers, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
22715  __Pyx_GOTREF(__pyx_t_2);
22716 
22717  /* "superluWrappers.pyx":15
22718  * class SparseMatrix(object):
22719  *
22720  * def __init__(self, # <<<<<<<<<<<<<<
22721  * nr,
22722  * nc,
22723  */
22724  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_1__init__, 0, __pyx_n_s_SparseMatrix___init, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error)
22725  __Pyx_GOTREF(__pyx_t_3);
22726  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
22727  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22728 
22729  /* "superluWrappers.pyx":35
22730  * self.rowptr)
22731  *
22732  * def matvec(self, x, y): # <<<<<<<<<<<<<<
22733  * """
22734  * Compute the sparse matrix-vector product y = Ax
22735  */
22736  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_3matvec, 0, __pyx_n_s_SparseMatrix_matvec, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error)
22737  __Pyx_GOTREF(__pyx_t_3);
22738  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_matvec, __pyx_t_3) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
22739  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22740 
22741  /* "superluWrappers.pyx":46
22742  * SparseMatrix_matvec(self._cSparseMatrix, x, y)
22743  *
22744  * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
22745  * """ Write the sparse matrix to a file
22746  *
22747  */
22748  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_5fwrite, 0, __pyx_n_s_SparseMatrix_fwrite, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error)
22749  __Pyx_GOTREF(__pyx_t_3);
22750  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_fwrite, __pyx_t_3) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
22751  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22752 
22753  /* "superluWrappers.pyx":62
22754  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
22755  *
22756  * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
22757  * """ Get the CSR representation of the sparse matrix.
22758  *
22759  */
22760  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_7getCSRrepresentation, 0, __pyx_n_s_SparseMatrix_getCSRrepresentatio, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
22761  __Pyx_GOTREF(__pyx_t_3);
22762  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getCSRrepresentation, __pyx_t_3) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
22763  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22764 
22765  /* "superluWrappers.pyx":72
22766  * return (self.rowptr, self.colind, self.nzvals)
22767  *
22768  * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
22769  * range_start,
22770  * range_end):
22771  */
22772  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation, 0, __pyx_n_s_SparseMatrix_getSubMatCSRreprese, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
22773  __Pyx_GOTREF(__pyx_t_3);
22774  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getSubMatCSRrepresentation, __pyx_t_3) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
22775  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22776 
22777  /* "superluWrappers.pyx":13
22778  * from libc.stdlib cimport malloc
22779  *
22780  * class SparseMatrix(object): # <<<<<<<<<<<<<<
22781  *
22782  * def __init__(self,
22783  */
22784  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SparseMatrix, __pyx_tuple__29, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error)
22785  __Pyx_GOTREF(__pyx_t_3);
22786  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SparseMatrix, __pyx_t_3) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
22787  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22788  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22789  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22790 
22791  /* "superluWrappers.pyx":219
22792  * self.X.Store = &self.storeX
22793  *
22794  * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
22795  * sparseFactor):
22796  * """ Python wrapper for superlu Sparse Factor Prepare function.
22797  */
22798  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15superluWrappers_1sparseFactorPrepare, NULL, __pyx_n_s_superluWrappers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
22799  __Pyx_GOTREF(__pyx_t_1);
22800  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparseFactorPrepare, __pyx_t_1) < 0) __PYX_ERR(0, 219, __pyx_L1_error)
22801  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22802 
22803  /* "superluWrappers.pyx":286
22804  * &info)
22805  *
22806  * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
22807  * x):
22808  * """ Sparse factor solve wrappers
22809  */
22810  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15superluWrappers_3sparseFactorSolve, NULL, __pyx_n_s_superluWrappers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
22811  __Pyx_GOTREF(__pyx_t_1);
22812  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparseFactorSolve, __pyx_t_1) < 0) __PYX_ERR(0, 286, __pyx_L1_error)
22813  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22814 
22815  /* "superluWrappers.pyx":1
22816  * #cython: boundscheck=False, wraparound=False, nonecheck=False, initializedcheck=False # <<<<<<<<<<<<<<
22817  *
22818  * # ARB - the cython directives above allow code to run much faster. it is worth noting
22819  */
22820  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22821  __Pyx_GOTREF(__pyx_t_1);
22822  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22823  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22824 
22825  /* "View.MemoryView":209
22826  * info.obj = self
22827  *
22828  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
22829  *
22830  * def __dealloc__(array self):
22831  */
22832  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
22833  __Pyx_GOTREF(__pyx_t_1);
22834  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
22835  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22836  PyType_Modified(__pyx_array_type);
22837 
22838  /* "View.MemoryView":286
22839  * return self.name
22840  *
22841  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
22842  * cdef strided = Enum("<strided and direct>") # default
22843  * cdef indirect = Enum("<strided and indirect>")
22844  */
22845  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
22846  __Pyx_GOTREF(__pyx_t_1);
22847  __Pyx_XGOTREF(generic);
22848  __Pyx_DECREF_SET(generic, __pyx_t_1);
22849  __Pyx_GIVEREF(__pyx_t_1);
22850  __pyx_t_1 = 0;
22851 
22852  /* "View.MemoryView":287
22853  *
22854  * cdef generic = Enum("<strided and direct or indirect>")
22855  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
22856  * cdef indirect = Enum("<strided and indirect>")
22857  *
22858  */
22859  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
22860  __Pyx_GOTREF(__pyx_t_1);
22861  __Pyx_XGOTREF(strided);
22862  __Pyx_DECREF_SET(strided, __pyx_t_1);
22863  __Pyx_GIVEREF(__pyx_t_1);
22864  __pyx_t_1 = 0;
22865 
22866  /* "View.MemoryView":288
22867  * cdef generic = Enum("<strided and direct or indirect>")
22868  * cdef strided = Enum("<strided and direct>") # default
22869  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
22870  *
22871  *
22872  */
22873  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
22874  __Pyx_GOTREF(__pyx_t_1);
22875  __Pyx_XGOTREF(indirect);
22876  __Pyx_DECREF_SET(indirect, __pyx_t_1);
22877  __Pyx_GIVEREF(__pyx_t_1);
22878  __pyx_t_1 = 0;
22879 
22880  /* "View.MemoryView":291
22881  *
22882  *
22883  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
22884  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
22885  *
22886  */
22887  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
22888  __Pyx_GOTREF(__pyx_t_1);
22889  __Pyx_XGOTREF(contiguous);
22890  __Pyx_DECREF_SET(contiguous, __pyx_t_1);
22891  __Pyx_GIVEREF(__pyx_t_1);
22892  __pyx_t_1 = 0;
22893 
22894  /* "View.MemoryView":292
22895  *
22896  * cdef contiguous = Enum("<contiguous and direct>")
22897  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
22898  *
22899  *
22900  */
22901  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
22902  __Pyx_GOTREF(__pyx_t_1);
22903  __Pyx_XGOTREF(indirect_contiguous);
22904  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
22905  __Pyx_GIVEREF(__pyx_t_1);
22906  __pyx_t_1 = 0;
22907 
22908  /* "View.MemoryView":316
22909  *
22910  * DEF THREAD_LOCKS_PREALLOCATED = 8
22911  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
22912  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
22913  * PyThread_allocate_lock(),
22914  */
22915  __pyx_memoryview_thread_locks_used = 0;
22916 
22917  /* "View.MemoryView":317
22918  * DEF THREAD_LOCKS_PREALLOCATED = 8
22919  * cdef int __pyx_memoryview_thread_locks_used = 0
22920  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
22921  * PyThread_allocate_lock(),
22922  * PyThread_allocate_lock(),
22923  */
22924  __pyx_t_4[0] = PyThread_allocate_lock();
22925  __pyx_t_4[1] = PyThread_allocate_lock();
22926  __pyx_t_4[2] = PyThread_allocate_lock();
22927  __pyx_t_4[3] = PyThread_allocate_lock();
22928  __pyx_t_4[4] = PyThread_allocate_lock();
22929  __pyx_t_4[5] = PyThread_allocate_lock();
22930  __pyx_t_4[6] = PyThread_allocate_lock();
22931  __pyx_t_4[7] = PyThread_allocate_lock();
22932  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_4, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
22933 
22934  /* "View.MemoryView":549
22935  * info.obj = self
22936  *
22937  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
22938  *
22939  *
22940  */
22941  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
22942  __Pyx_GOTREF(__pyx_t_1);
22943  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
22944  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22945  PyType_Modified(__pyx_memoryview_type);
22946 
22947  /* "View.MemoryView":995
22948  * return self.from_object
22949  *
22950  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
22951  *
22952  *
22953  */
22954  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 995, __pyx_L1_error)
22955  __Pyx_GOTREF(__pyx_t_1);
22956  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
22957  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22958  PyType_Modified(__pyx_memoryviewslice_type);
22959 
22960  /* "(tree fragment)":1
22961  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
22962  * cdef object __pyx_PickleError
22963  * cdef object __pyx_result
22964  */
22965  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
22966  __Pyx_GOTREF(__pyx_t_1);
22967  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
22968  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22969 
22970  /* "(tree fragment)":11
22971  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
22972  * return __pyx_result
22973  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
22974  * __pyx_result.name = __pyx_state[0]
22975  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
22976  */
22977 
22978  /*--- Wrapped vars code ---*/
22979 
22980  goto __pyx_L0;
22981  __pyx_L1_error:;
22982  __Pyx_XDECREF(__pyx_t_1);
22983  __Pyx_XDECREF(__pyx_t_2);
22984  __Pyx_XDECREF(__pyx_t_3);
22985  if (__pyx_m) {
22986  if (__pyx_d) {
22987  __Pyx_AddTraceback("init superluWrappers", __pyx_clineno, __pyx_lineno, __pyx_filename);
22988  }
22989  Py_CLEAR(__pyx_m);
22990  } else if (!PyErr_Occurred()) {
22991  PyErr_SetString(PyExc_ImportError, "init superluWrappers");
22992  }
22993  __pyx_L0:;
22994  __Pyx_RefNannyFinishContext();
22995  #if CYTHON_PEP489_MULTI_PHASE_INIT
22996  return (__pyx_m != NULL) ? 0 : -1;
22997  #elif PY_MAJOR_VERSION >= 3
22998  return __pyx_m;
22999  #else
23000  return;
23001  #endif
23002 }
23003 
23004 /* --- Runtime support code --- */
23005 /* Refnanny */
23006 #if CYTHON_REFNANNY
23007 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
23008  PyObject *m = NULL, *p = NULL;
23009  void *r = NULL;
23010  m = PyImport_ImportModule(modname);
23011  if (!m) goto end;
23012  p = PyObject_GetAttrString(m, "RefNannyAPI");
23013  if (!p) goto end;
23014  r = PyLong_AsVoidPtr(p);
23015 end:
23016  Py_XDECREF(p);
23017  Py_XDECREF(m);
23018  return (__Pyx_RefNannyAPIStruct *)r;
23019 }
23020 #endif
23021 
23022 /* PyObjectGetAttrStr */
23023 #if CYTHON_USE_TYPE_SLOTS
23024 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23025  PyTypeObject* tp = Py_TYPE(obj);
23026  if (likely(tp->tp_getattro))
23027  return tp->tp_getattro(obj, attr_name);
23028 #if PY_MAJOR_VERSION < 3
23029  if (likely(tp->tp_getattr))
23030  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23031 #endif
23032  return PyObject_GetAttr(obj, attr_name);
23033 }
23034 #endif
23035 
23036 /* GetBuiltinName */
23037 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23038  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23039  if (unlikely(!result)) {
23040  PyErr_Format(PyExc_NameError,
23041 #if PY_MAJOR_VERSION >= 3
23042  "name '%U' is not defined", name);
23043 #else
23044  "name '%.200s' is not defined", PyString_AS_STRING(name));
23045 #endif
23046  }
23047  return result;
23048 }
23049 
23050 /* RaiseArgTupleInvalid */
23051 static void __Pyx_RaiseArgtupleInvalid(
23052  const char* func_name,
23053  int exact,
23054  Py_ssize_t num_min,
23055  Py_ssize_t num_max,
23056  Py_ssize_t num_found)
23057 {
23058  Py_ssize_t num_expected;
23059  const char *more_or_less;
23060  if (num_found < num_min) {
23061  num_expected = num_min;
23062  more_or_less = "at least";
23063  } else {
23064  num_expected = num_max;
23065  more_or_less = "at most";
23066  }
23067  if (exact) {
23068  more_or_less = "exactly";
23069  }
23070  PyErr_Format(PyExc_TypeError,
23071  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
23072  func_name, more_or_less, num_expected,
23073  (num_expected == 1) ? "" : "s", num_found);
23074 }
23075 
23076 /* RaiseDoubleKeywords */
23077 static void __Pyx_RaiseDoubleKeywordsError(
23078  const char* func_name,
23079  PyObject* kw_name)
23080 {
23081  PyErr_Format(PyExc_TypeError,
23082  #if PY_MAJOR_VERSION >= 3
23083  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23084  #else
23085  "%s() got multiple values for keyword argument '%s'", func_name,
23086  PyString_AsString(kw_name));
23087  #endif
23088 }
23089 
23090 /* ParseKeywords */
23091 static int __Pyx_ParseOptionalKeywords(
23092  PyObject *kwds,
23093  PyObject **argnames[],
23094  PyObject *kwds2,
23095  PyObject *values[],
23096  Py_ssize_t num_pos_args,
23097  const char* function_name)
23098 {
23099  PyObject *key = 0, *value = 0;
23100  Py_ssize_t pos = 0;
23101  PyObject*** name;
23102  PyObject*** first_kw_arg = argnames + num_pos_args;
23103  while (PyDict_Next(kwds, &pos, &key, &value)) {
23104  name = first_kw_arg;
23105  while (*name && (**name != key)) name++;
23106  if (*name) {
23107  values[name-argnames] = value;
23108  continue;
23109  }
23110  name = first_kw_arg;
23111  #if PY_MAJOR_VERSION < 3
23112  if (likely(PyString_Check(key))) {
23113  while (*name) {
23114  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23115  && _PyString_Eq(**name, key)) {
23116  values[name-argnames] = value;
23117  break;
23118  }
23119  name++;
23120  }
23121  if (*name) continue;
23122  else {
23123  PyObject*** argname = argnames;
23124  while (argname != first_kw_arg) {
23125  if ((**argname == key) || (
23126  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23127  && _PyString_Eq(**argname, key))) {
23128  goto arg_passed_twice;
23129  }
23130  argname++;
23131  }
23132  }
23133  } else
23134  #endif
23135  if (likely(PyUnicode_Check(key))) {
23136  while (*name) {
23137  int cmp = (**name == key) ? 0 :
23138  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23139  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23140  #endif
23141  PyUnicode_Compare(**name, key);
23142  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23143  if (cmp == 0) {
23144  values[name-argnames] = value;
23145  break;
23146  }
23147  name++;
23148  }
23149  if (*name) continue;
23150  else {
23151  PyObject*** argname = argnames;
23152  while (argname != first_kw_arg) {
23153  int cmp = (**argname == key) ? 0 :
23154  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23155  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23156  #endif
23157  PyUnicode_Compare(**argname, key);
23158  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23159  if (cmp == 0) goto arg_passed_twice;
23160  argname++;
23161  }
23162  }
23163  } else
23164  goto invalid_keyword_type;
23165  if (kwds2) {
23166  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
23167  } else {
23168  goto invalid_keyword;
23169  }
23170  }
23171  return 0;
23172 arg_passed_twice:
23173  __Pyx_RaiseDoubleKeywordsError(function_name, key);
23174  goto bad;
23175 invalid_keyword_type:
23176  PyErr_Format(PyExc_TypeError,
23177  "%.200s() keywords must be strings", function_name);
23178  goto bad;
23179 invalid_keyword:
23180  PyErr_Format(PyExc_TypeError,
23181  #if PY_MAJOR_VERSION < 3
23182  "%.200s() got an unexpected keyword argument '%.200s'",
23183  function_name, PyString_AsString(key));
23184  #else
23185  "%s() got an unexpected keyword argument '%U'",
23186  function_name, key);
23187  #endif
23188 bad:
23189  return -1;
23190 }
23191 
23192 /* PyObjectSetAttrStr */
23193 #if CYTHON_USE_TYPE_SLOTS
23194 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
23195  PyTypeObject* tp = Py_TYPE(obj);
23196  if (likely(tp->tp_setattro))
23197  return tp->tp_setattro(obj, attr_name, value);
23198 #if PY_MAJOR_VERSION < 3
23199  if (likely(tp->tp_setattr))
23200  return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
23201 #endif
23202  return PyObject_SetAttr(obj, attr_name, value);
23203 }
23204 #endif
23205 
23206 /* PyObjectCall */
23207 #if CYTHON_COMPILING_IN_CPYTHON
23208 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
23209  PyObject *result;
23210  ternaryfunc call = func->ob_type->tp_call;
23211  if (unlikely(!call))
23212  return PyObject_Call(func, arg, kw);
23213  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
23214  return NULL;
23215  result = (*call)(func, arg, kw);
23216  Py_LeaveRecursiveCall();
23217  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
23218  PyErr_SetString(
23219  PyExc_SystemError,
23220  "NULL result without error in PyObject_Call");
23221  }
23222  return result;
23223 }
23224 #endif
23225 
23226 /* ExtTypeTest */
23227 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
23228  if (unlikely(!type)) {
23229  PyErr_SetString(PyExc_SystemError, "Missing type object");
23230  return 0;
23231  }
23232  if (likely(__Pyx_TypeCheck(obj, type)))
23233  return 1;
23234  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
23235  Py_TYPE(obj)->tp_name, type->tp_name);
23236  return 0;
23237 }
23238 
23239 /* MemviewSliceInit */
23240 static int
23241 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
23242  int ndim,
23243  __Pyx_memviewslice *memviewslice,
23244  int memview_is_new_reference)
23245 {
23246  __Pyx_RefNannyDeclarations
23247  int i, retval=-1;
23248  Py_buffer *buf = &memview->view;
23249  __Pyx_RefNannySetupContext("init_memviewslice", 0);
23250  if (unlikely(memviewslice->memview || memviewslice->data)) {
23251  PyErr_SetString(PyExc_ValueError,
23252  "memviewslice is already initialized!");
23253  goto fail;
23254  }
23255  if (buf->strides) {
23256  for (i = 0; i < ndim; i++) {
23257  memviewslice->strides[i] = buf->strides[i];
23258  }
23259  } else {
23260  Py_ssize_t stride = buf->itemsize;
23261  for (i = ndim - 1; i >= 0; i--) {
23262  memviewslice->strides[i] = stride;
23263  stride *= buf->shape[i];
23264  }
23265  }
23266  for (i = 0; i < ndim; i++) {
23267  memviewslice->shape[i] = buf->shape[i];
23268  if (buf->suboffsets) {
23269  memviewslice->suboffsets[i] = buf->suboffsets[i];
23270  } else {
23271  memviewslice->suboffsets[i] = -1;
23272  }
23273  }
23274  memviewslice->memview = memview;
23275  memviewslice->data = (char *)buf->buf;
23276  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
23277  Py_INCREF(memview);
23278  }
23279  retval = 0;
23280  goto no_fail;
23281 fail:
23282  memviewslice->memview = 0;
23283  memviewslice->data = 0;
23284  retval = -1;
23285 no_fail:
23286  __Pyx_RefNannyFinishContext();
23287  return retval;
23288 }
23289 #ifndef Py_NO_RETURN
23290 #define Py_NO_RETURN
23291 #endif
23292 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
23293  va_list vargs;
23294  char msg[200];
23295 #ifdef HAVE_STDARG_PROTOTYPES
23296  va_start(vargs, fmt);
23297 #else
23298  va_start(vargs);
23299 #endif
23300  vsnprintf(msg, 200, fmt, vargs);
23301  va_end(vargs);
23302  Py_FatalError(msg);
23303 }
23304 static CYTHON_INLINE int
23305 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
23306  PyThread_type_lock lock)
23307 {
23308  int result;
23309  PyThread_acquire_lock(lock, 1);
23310  result = (*acquisition_count)++;
23311  PyThread_release_lock(lock);
23312  return result;
23313 }
23314 static CYTHON_INLINE int
23315 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
23316  PyThread_type_lock lock)
23317 {
23318  int result;
23319  PyThread_acquire_lock(lock, 1);
23320  result = (*acquisition_count)--;
23321  PyThread_release_lock(lock);
23322  return result;
23323 }
23324 static CYTHON_INLINE void
23325 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
23326 {
23327  int first_time;
23328  struct __pyx_memoryview_obj *memview = memslice->memview;
23329  if (unlikely(!memview || (PyObject *) memview == Py_None))
23330  return;
23331  if (unlikely(__pyx_get_slice_count(memview) < 0))
23332  __pyx_fatalerror("Acquisition count is %d (line %d)",
23333  __pyx_get_slice_count(memview), lineno);
23334  first_time = __pyx_add_acquisition_count(memview) == 0;
23335  if (unlikely(first_time)) {
23336  if (have_gil) {
23337  Py_INCREF((PyObject *) memview);
23338  } else {
23339  PyGILState_STATE _gilstate = PyGILState_Ensure();
23340  Py_INCREF((PyObject *) memview);
23341  PyGILState_Release(_gilstate);
23342  }
23343  }
23344 }
23345 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
23346  int have_gil, int lineno) {
23347  int last_time;
23348  struct __pyx_memoryview_obj *memview = memslice->memview;
23349  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
23350  memslice->memview = NULL;
23351  return;
23352  }
23353  if (unlikely(__pyx_get_slice_count(memview) <= 0))
23354  __pyx_fatalerror("Acquisition count is %d (line %d)",
23355  __pyx_get_slice_count(memview), lineno);
23356  last_time = __pyx_sub_acquisition_count(memview) == 1;
23357  memslice->data = NULL;
23358  if (unlikely(last_time)) {
23359  if (have_gil) {
23360  Py_CLEAR(memslice->memview);
23361  } else {
23362  PyGILState_STATE _gilstate = PyGILState_Ensure();
23363  Py_CLEAR(memslice->memview);
23364  PyGILState_Release(_gilstate);
23365  }
23366  } else {
23367  memslice->memview = NULL;
23368  }
23369 }
23370 
23371 /* PyFunctionFastCall */
23372 #if CYTHON_FAST_PYCALL
23373 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
23374  PyObject *globals) {
23375  PyFrameObject *f;
23376  PyThreadState *tstate = __Pyx_PyThreadState_Current;
23377  PyObject **fastlocals;
23378  Py_ssize_t i;
23379  PyObject *result;
23380  assert(globals != NULL);
23381  /* XXX Perhaps we should create a specialized
23382  PyFrame_New() that doesn't take locals, but does
23383  take builtins without sanity checking them.
23384  */
23385  assert(tstate != NULL);
23386  f = PyFrame_New(tstate, co, globals, NULL);
23387  if (f == NULL) {
23388  return NULL;
23389  }
23390  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
23391  for (i = 0; i < na; i++) {
23392  Py_INCREF(*args);
23393  fastlocals[i] = *args++;
23394  }
23395  result = PyEval_EvalFrameEx(f,0);
23396  ++tstate->recursion_depth;
23397  Py_DECREF(f);
23398  --tstate->recursion_depth;
23399  return result;
23400 }
23401 #if 1 || PY_VERSION_HEX < 0x030600B1
23402 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
23403  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
23404  PyObject *globals = PyFunction_GET_GLOBALS(func);
23405  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
23406  PyObject *closure;
23407 #if PY_MAJOR_VERSION >= 3
23408  PyObject *kwdefs;
23409 #endif
23410  PyObject *kwtuple, **k;
23411  PyObject **d;
23412  Py_ssize_t nd;
23413  Py_ssize_t nk;
23414  PyObject *result;
23415  assert(kwargs == NULL || PyDict_Check(kwargs));
23416  nk = kwargs ? PyDict_Size(kwargs) : 0;
23417  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
23418  return NULL;
23419  }
23420  if (
23421 #if PY_MAJOR_VERSION >= 3
23422  co->co_kwonlyargcount == 0 &&
23423 #endif
23424  likely(kwargs == NULL || nk == 0) &&
23425  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
23426  if (argdefs == NULL && co->co_argcount == nargs) {
23427  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
23428  goto done;
23429  }
23430  else if (nargs == 0 && argdefs != NULL
23431  && co->co_argcount == Py_SIZE(argdefs)) {
23432  /* function called with no arguments, but all parameters have
23433  a default value: use default values as arguments .*/
23434  args = &PyTuple_GET_ITEM(argdefs, 0);
23435  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
23436  goto done;
23437  }
23438  }
23439  if (kwargs != NULL) {
23440  Py_ssize_t pos, i;
23441  kwtuple = PyTuple_New(2 * nk);
23442  if (kwtuple == NULL) {
23443  result = NULL;
23444  goto done;
23445  }
23446  k = &PyTuple_GET_ITEM(kwtuple, 0);
23447  pos = i = 0;
23448  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
23449  Py_INCREF(k[i]);
23450  Py_INCREF(k[i+1]);
23451  i += 2;
23452  }
23453  nk = i / 2;
23454  }
23455  else {
23456  kwtuple = NULL;
23457  k = NULL;
23458  }
23459  closure = PyFunction_GET_CLOSURE(func);
23460 #if PY_MAJOR_VERSION >= 3
23461  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
23462 #endif
23463  if (argdefs != NULL) {
23464  d = &PyTuple_GET_ITEM(argdefs, 0);
23465  nd = Py_SIZE(argdefs);
23466  }
23467  else {
23468  d = NULL;
23469  nd = 0;
23470  }
23471 #if PY_MAJOR_VERSION >= 3
23472  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
23473  args, (int)nargs,
23474  k, (int)nk,
23475  d, (int)nd, kwdefs, closure);
23476 #else
23477  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
23478  args, (int)nargs,
23479  k, (int)nk,
23480  d, (int)nd, closure);
23481 #endif
23482  Py_XDECREF(kwtuple);
23483 done:
23484  Py_LeaveRecursiveCall();
23485  return result;
23486 }
23487 #endif
23488 #endif
23489 
23490 /* PyObjectCallMethO */
23491 #if CYTHON_COMPILING_IN_CPYTHON
23492 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
23493  PyObject *self, *result;
23494  PyCFunction cfunc;
23495  cfunc = PyCFunction_GET_FUNCTION(func);
23496  self = PyCFunction_GET_SELF(func);
23497  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
23498  return NULL;
23499  result = cfunc(self, arg);
23500  Py_LeaveRecursiveCall();
23501  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
23502  PyErr_SetString(
23503  PyExc_SystemError,
23504  "NULL result without error in PyObject_Call");
23505  }
23506  return result;
23507 }
23508 #endif
23509 
23510 /* PyObjectCallNoArg */
23511 #if CYTHON_COMPILING_IN_CPYTHON
23512 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
23513 #if CYTHON_FAST_PYCALL
23514  if (PyFunction_Check(func)) {
23515  return __Pyx_PyFunction_FastCall(func, NULL, 0);
23516  }
23517 #endif
23518 #ifdef __Pyx_CyFunction_USED
23519  if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
23520 #else
23521  if (likely(PyCFunction_Check(func)))
23522 #endif
23523  {
23524  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
23525  return __Pyx_PyObject_CallMethO(func, NULL);
23526  }
23527  }
23528  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
23529 }
23530 #endif
23531 
23532 /* PyCFunctionFastCall */
23533 #if CYTHON_FAST_PYCCALL
23534 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
23535  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
23536  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
23537  PyObject *self = PyCFunction_GET_SELF(func);
23538  int flags = PyCFunction_GET_FLAGS(func);
23539  assert(PyCFunction_Check(func));
23540  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
23541  assert(nargs >= 0);
23542  assert(nargs == 0 || args != NULL);
23543  /* _PyCFunction_FastCallDict() must not be called with an exception set,
23544  because it may clear it (directly or indirectly) and so the
23545  caller loses its exception */
23546  assert(!PyErr_Occurred());
23547  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
23548  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
23549  } else {
23550  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
23551  }
23552 }
23553 #endif
23554 
23555 /* PyObjectCallOneArg */
23556 #if CYTHON_COMPILING_IN_CPYTHON
23557 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23558  PyObject *result;
23559  PyObject *args = PyTuple_New(1);
23560  if (unlikely(!args)) return NULL;
23561  Py_INCREF(arg);
23562  PyTuple_SET_ITEM(args, 0, arg);
23563  result = __Pyx_PyObject_Call(func, args, NULL);
23564  Py_DECREF(args);
23565  return result;
23566 }
23567 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23568 #if CYTHON_FAST_PYCALL
23569  if (PyFunction_Check(func)) {
23570  return __Pyx_PyFunction_FastCall(func, &arg, 1);
23571  }
23572 #endif
23573  if (likely(PyCFunction_Check(func))) {
23574  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
23575  return __Pyx_PyObject_CallMethO(func, arg);
23576 #if CYTHON_FAST_PYCCALL
23577  } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
23578  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
23579 #endif
23580  }
23581  }
23582  return __Pyx__PyObject_CallOneArg(func, arg);
23583 }
23584 #else
23585 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23586  PyObject *result;
23587  PyObject *args = PyTuple_Pack(1, arg);
23588  if (unlikely(!args)) return NULL;
23589  result = __Pyx_PyObject_Call(func, args, NULL);
23590  Py_DECREF(args);
23591  return result;
23592 }
23593 #endif
23594 
23595 /* GetItemInt */
23596 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
23597  PyObject *r;
23598  if (!j) return NULL;
23599  r = PyObject_GetItem(o, j);
23600  Py_DECREF(j);
23601  return r;
23602 }
23603 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
23604  CYTHON_NCP_UNUSED int wraparound,
23605  CYTHON_NCP_UNUSED int boundscheck) {
23606 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23607  Py_ssize_t wrapped_i = i;
23608  if (wraparound & unlikely(i < 0)) {
23609  wrapped_i += PyList_GET_SIZE(o);
23610  }
23611  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
23612  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
23613  Py_INCREF(r);
23614  return r;
23615  }
23616  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23617 #else
23618  return PySequence_GetItem(o, i);
23619 #endif
23620 }
23621 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
23622  CYTHON_NCP_UNUSED int wraparound,
23623  CYTHON_NCP_UNUSED int boundscheck) {
23624 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23625  Py_ssize_t wrapped_i = i;
23626  if (wraparound & unlikely(i < 0)) {
23627  wrapped_i += PyTuple_GET_SIZE(o);
23628  }
23629  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
23630  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
23631  Py_INCREF(r);
23632  return r;
23633  }
23634  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23635 #else
23636  return PySequence_GetItem(o, i);
23637 #endif
23638 }
23639 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
23640  CYTHON_NCP_UNUSED int wraparound,
23641  CYTHON_NCP_UNUSED int boundscheck) {
23642 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
23643  if (is_list || PyList_CheckExact(o)) {
23644  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
23645  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
23646  PyObject *r = PyList_GET_ITEM(o, n);
23647  Py_INCREF(r);
23648  return r;
23649  }
23650  }
23651  else if (PyTuple_CheckExact(o)) {
23652  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
23653  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
23654  PyObject *r = PyTuple_GET_ITEM(o, n);
23655  Py_INCREF(r);
23656  return r;
23657  }
23658  } else {
23659  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
23660  if (likely(m && m->sq_item)) {
23661  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
23662  Py_ssize_t l = m->sq_length(o);
23663  if (likely(l >= 0)) {
23664  i += l;
23665  } else {
23666  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
23667  return NULL;
23668  PyErr_Clear();
23669  }
23670  }
23671  return m->sq_item(o, i);
23672  }
23673  }
23674 #else
23675  if (is_list || PySequence_Check(o)) {
23676  return PySequence_GetItem(o, i);
23677  }
23678 #endif
23679  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23680 }
23681 
23682 /* ObjectGetItem */
23683 #if CYTHON_USE_TYPE_SLOTS
23684 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
23685  PyObject *runerr;
23686  Py_ssize_t key_value;
23687  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
23688  if (unlikely(!(m && m->sq_item))) {
23689  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
23690  return NULL;
23691  }
23692  key_value = __Pyx_PyIndex_AsSsize_t(index);
23693  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
23694  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
23695  }
23696  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
23697  PyErr_Clear();
23698  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
23699  }
23700  return NULL;
23701 }
23702 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
23703  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
23704  if (likely(m && m->mp_subscript)) {
23705  return m->mp_subscript(obj, key);
23706  }
23707  return __Pyx_PyObject_GetIndex(obj, key);
23708 }
23709 #endif
23710 
23711 /* PyObjectCall2Args */
23712 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
23713  PyObject *args, *result = NULL;
23714  #if CYTHON_FAST_PYCALL
23715  if (PyFunction_Check(function)) {
23716  PyObject *args[2] = {arg1, arg2};
23717  return __Pyx_PyFunction_FastCall(function, args, 2);
23718  }
23719  #endif
23720  #if CYTHON_FAST_PYCCALL
23721  if (__Pyx_PyFastCFunction_Check(function)) {
23722  PyObject *args[2] = {arg1, arg2};
23723  return __Pyx_PyCFunction_FastCall(function, args, 2);
23724  }
23725  #endif
23726  args = PyTuple_New(2);
23727  if (unlikely(!args)) goto done;
23728  Py_INCREF(arg1);
23729  PyTuple_SET_ITEM(args, 0, arg1);
23730  Py_INCREF(arg2);
23731  PyTuple_SET_ITEM(args, 1, arg2);
23732  Py_INCREF(function);
23733  result = __Pyx_PyObject_Call(function, args, NULL);
23734  Py_DECREF(args);
23735  Py_DECREF(function);
23736 done:
23737  return result;
23738 }
23739 
23740 /* PyIntBinop */
23741 #if !CYTHON_COMPILING_IN_PYPY
23742 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
23743  (void)inplace;
23744  (void)zerodivision_check;
23745  #if PY_MAJOR_VERSION < 3
23746  if (likely(PyInt_CheckExact(op1))) {
23747  const long b = intval;
23748  long x;
23749  long a = PyInt_AS_LONG(op1);
23750  x = (long)((unsigned long)a + b);
23751  if (likely((x^a) >= 0 || (x^b) >= 0))
23752  return PyInt_FromLong(x);
23753  return PyLong_Type.tp_as_number->nb_add(op1, op2);
23754  }
23755  #endif
23756  #if CYTHON_USE_PYLONG_INTERNALS
23757  if (likely(PyLong_CheckExact(op1))) {
23758  const long b = intval;
23759  long a, x;
23760 #ifdef HAVE_LONG_LONG
23761  const PY_LONG_LONG llb = intval;
23762  PY_LONG_LONG lla, llx;
23763 #endif
23764  const digit* digits = ((PyLongObject*)op1)->ob_digit;
23765  const Py_ssize_t size = Py_SIZE(op1);
23766  if (likely(__Pyx_sst_abs(size) <= 1)) {
23767  a = likely(size) ? digits[0] : 0;
23768  if (size == -1) a = -a;
23769  } else {
23770  switch (size) {
23771  case -2:
23772  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
23773  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23774  break;
23775 #ifdef HAVE_LONG_LONG
23776  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
23777  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23778  goto long_long;
23779 #endif
23780  }
23781  CYTHON_FALLTHROUGH;
23782  case 2:
23783  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
23784  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23785  break;
23786 #ifdef HAVE_LONG_LONG
23787  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
23788  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23789  goto long_long;
23790 #endif
23791  }
23792  CYTHON_FALLTHROUGH;
23793  case -3:
23794  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
23795  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23796  break;
23797 #ifdef HAVE_LONG_LONG
23798  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
23799  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23800  goto long_long;
23801 #endif
23802  }
23803  CYTHON_FALLTHROUGH;
23804  case 3:
23805  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
23806  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23807  break;
23808 #ifdef HAVE_LONG_LONG
23809  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
23810  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23811  goto long_long;
23812 #endif
23813  }
23814  CYTHON_FALLTHROUGH;
23815  case -4:
23816  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
23817  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23818  break;
23819 #ifdef HAVE_LONG_LONG
23820  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
23821  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23822  goto long_long;
23823 #endif
23824  }
23825  CYTHON_FALLTHROUGH;
23826  case 4:
23827  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
23828  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23829  break;
23830 #ifdef HAVE_LONG_LONG
23831  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
23832  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23833  goto long_long;
23834 #endif
23835  }
23836  CYTHON_FALLTHROUGH;
23837  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
23838  }
23839  }
23840  x = a + b;
23841  return PyLong_FromLong(x);
23842 #ifdef HAVE_LONG_LONG
23843  long_long:
23844  llx = lla + llb;
23845  return PyLong_FromLongLong(llx);
23846 #endif
23847 
23848 
23849  }
23850  #endif
23851  if (PyFloat_CheckExact(op1)) {
23852  const long b = intval;
23853  double a = PyFloat_AS_DOUBLE(op1);
23854  double result;
23855  PyFPE_START_PROTECT("add", return NULL)
23856  result = ((double)a) + (double)b;
23857  PyFPE_END_PROTECT(result)
23858  return PyFloat_FromDouble(result);
23859  }
23860  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
23861 }
23862 #endif
23863 
23864 /* GetTopmostException */
23865 #if CYTHON_USE_EXC_INFO_STACK
23866 static _PyErr_StackItem *
23867 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
23868 {
23869  _PyErr_StackItem *exc_info = tstate->exc_info;
23870  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
23871  exc_info->previous_item != NULL)
23872  {
23873  exc_info = exc_info->previous_item;
23874  }
23875  return exc_info;
23876 }
23877 #endif
23878 
23879 /* SaveResetException */
23880 #if CYTHON_FAST_THREAD_STATE
23881 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23882  #if CYTHON_USE_EXC_INFO_STACK
23883  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
23884  *type = exc_info->exc_type;
23885  *value = exc_info->exc_value;
23886  *tb = exc_info->exc_traceback;
23887  #else
23888  *type = tstate->exc_type;
23889  *value = tstate->exc_value;
23890  *tb = tstate->exc_traceback;
23891  #endif
23892  Py_XINCREF(*type);
23893  Py_XINCREF(*value);
23894  Py_XINCREF(*tb);
23895 }
23896 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
23897  PyObject *tmp_type, *tmp_value, *tmp_tb;
23898  #if CYTHON_USE_EXC_INFO_STACK
23899  _PyErr_StackItem *exc_info = tstate->exc_info;
23900  tmp_type = exc_info->exc_type;
23901  tmp_value = exc_info->exc_value;
23902  tmp_tb = exc_info->exc_traceback;
23903  exc_info->exc_type = type;
23904  exc_info->exc_value = value;
23905  exc_info->exc_traceback = tb;
23906  #else
23907  tmp_type = tstate->exc_type;
23908  tmp_value = tstate->exc_value;
23909  tmp_tb = tstate->exc_traceback;
23910  tstate->exc_type = type;
23911  tstate->exc_value = value;
23912  tstate->exc_traceback = tb;
23913  #endif
23914  Py_XDECREF(tmp_type);
23915  Py_XDECREF(tmp_value);
23916  Py_XDECREF(tmp_tb);
23917 }
23918 #endif
23919 
23920 /* GetException */
23921 #if CYTHON_FAST_THREAD_STATE
23922 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
23923 #else
23924 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
23925 #endif
23926 {
23927  PyObject *local_type, *local_value, *local_tb;
23928 #if CYTHON_FAST_THREAD_STATE
23929  PyObject *tmp_type, *tmp_value, *tmp_tb;
23930  local_type = tstate->curexc_type;
23931  local_value = tstate->curexc_value;
23932  local_tb = tstate->curexc_traceback;
23933  tstate->curexc_type = 0;
23934  tstate->curexc_value = 0;
23935  tstate->curexc_traceback = 0;
23936 #else
23937  PyErr_Fetch(&local_type, &local_value, &local_tb);
23938 #endif
23939  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
23940 #if CYTHON_FAST_THREAD_STATE
23941  if (unlikely(tstate->curexc_type))
23942 #else
23943  if (unlikely(PyErr_Occurred()))
23944 #endif
23945  goto bad;
23946  #if PY_MAJOR_VERSION >= 3
23947  if (local_tb) {
23948  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
23949  goto bad;
23950  }
23951  #endif
23952  Py_XINCREF(local_tb);
23953  Py_XINCREF(local_type);
23954  Py_XINCREF(local_value);
23955  *type = local_type;
23956  *value = local_value;
23957  *tb = local_tb;
23958 #if CYTHON_FAST_THREAD_STATE
23959  #if CYTHON_USE_EXC_INFO_STACK
23960  {
23961  _PyErr_StackItem *exc_info = tstate->exc_info;
23962  tmp_type = exc_info->exc_type;
23963  tmp_value = exc_info->exc_value;
23964  tmp_tb = exc_info->exc_traceback;
23965  exc_info->exc_type = local_type;
23966  exc_info->exc_value = local_value;
23967  exc_info->exc_traceback = local_tb;
23968  }
23969  #else
23970  tmp_type = tstate->exc_type;
23971  tmp_value = tstate->exc_value;
23972  tmp_tb = tstate->exc_traceback;
23973  tstate->exc_type = local_type;
23974  tstate->exc_value = local_value;
23975  tstate->exc_traceback = local_tb;
23976  #endif
23977  Py_XDECREF(tmp_type);
23978  Py_XDECREF(tmp_value);
23979  Py_XDECREF(tmp_tb);
23980 #else
23981  PyErr_SetExcInfo(local_type, local_value, local_tb);
23982 #endif
23983  return 0;
23984 bad:
23985  *type = 0;
23986  *value = 0;
23987  *tb = 0;
23988  Py_XDECREF(local_type);
23989  Py_XDECREF(local_value);
23990  Py_XDECREF(local_tb);
23991  return -1;
23992 }
23993 
23994 /* PyErrFetchRestore */
23995 #if CYTHON_FAST_THREAD_STATE
23996 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
23997  PyObject *tmp_type, *tmp_value, *tmp_tb;
23998  tmp_type = tstate->curexc_type;
23999  tmp_value = tstate->curexc_value;
24000  tmp_tb = tstate->curexc_traceback;
24001  tstate->curexc_type = type;
24002  tstate->curexc_value = value;
24003  tstate->curexc_traceback = tb;
24004  Py_XDECREF(tmp_type);
24005  Py_XDECREF(tmp_value);
24006  Py_XDECREF(tmp_tb);
24007 }
24008 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24009  *type = tstate->curexc_type;
24010  *value = tstate->curexc_value;
24011  *tb = tstate->curexc_traceback;
24012  tstate->curexc_type = 0;
24013  tstate->curexc_value = 0;
24014  tstate->curexc_traceback = 0;
24015 }
24016 #endif
24017 
24018 /* SliceObject */
24019 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
24020  Py_ssize_t cstart, Py_ssize_t cstop,
24021  PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
24022  int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
24023 #if CYTHON_USE_TYPE_SLOTS
24024  PyMappingMethods* mp;
24025 #if PY_MAJOR_VERSION < 3
24026  PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
24027  if (likely(ms && ms->sq_slice)) {
24028  if (!has_cstart) {
24029  if (_py_start && (*_py_start != Py_None)) {
24030  cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
24031  if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
24032  } else
24033  cstart = 0;
24034  }
24035  if (!has_cstop) {
24036  if (_py_stop && (*_py_stop != Py_None)) {
24037  cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
24038  if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
24039  } else
24040  cstop = PY_SSIZE_T_MAX;
24041  }
24042  if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
24043  Py_ssize_t l = ms->sq_length(obj);
24044  if (likely(l >= 0)) {
24045  if (cstop < 0) {
24046  cstop += l;
24047  if (cstop < 0) cstop = 0;
24048  }
24049  if (cstart < 0) {
24050  cstart += l;
24051  if (cstart < 0) cstart = 0;
24052  }
24053  } else {
24054  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24055  goto bad;
24056  PyErr_Clear();
24057  }
24058  }
24059  return ms->sq_slice(obj, cstart, cstop);
24060  }
24061 #endif
24062  mp = Py_TYPE(obj)->tp_as_mapping;
24063  if (likely(mp && mp->mp_subscript))
24064 #endif
24065  {
24066  PyObject* result;
24067  PyObject *py_slice, *py_start, *py_stop;
24068  if (_py_slice) {
24069  py_slice = *_py_slice;
24070  } else {
24071  PyObject* owned_start = NULL;
24072  PyObject* owned_stop = NULL;
24073  if (_py_start) {
24074  py_start = *_py_start;
24075  } else {
24076  if (has_cstart) {
24077  owned_start = py_start = PyInt_FromSsize_t(cstart);
24078  if (unlikely(!py_start)) goto bad;
24079  } else
24080  py_start = Py_None;
24081  }
24082  if (_py_stop) {
24083  py_stop = *_py_stop;
24084  } else {
24085  if (has_cstop) {
24086  owned_stop = py_stop = PyInt_FromSsize_t(cstop);
24087  if (unlikely(!py_stop)) {
24088  Py_XDECREF(owned_start);
24089  goto bad;
24090  }
24091  } else
24092  py_stop = Py_None;
24093  }
24094  py_slice = PySlice_New(py_start, py_stop, Py_None);
24095  Py_XDECREF(owned_start);
24096  Py_XDECREF(owned_stop);
24097  if (unlikely(!py_slice)) goto bad;
24098  }
24099 #if CYTHON_USE_TYPE_SLOTS
24100  result = mp->mp_subscript(obj, py_slice);
24101 #else
24102  result = PyObject_GetItem(obj, py_slice);
24103 #endif
24104  if (!_py_slice) {
24105  Py_DECREF(py_slice);
24106  }
24107  return result;
24108  }
24109  PyErr_Format(PyExc_TypeError,
24110  "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
24111 bad:
24112  return NULL;
24113 }
24114 
24115 /* RaiseException */
24116 #if PY_MAJOR_VERSION < 3
24117 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24118  CYTHON_UNUSED PyObject *cause) {
24119  __Pyx_PyThreadState_declare
24120  Py_XINCREF(type);
24121  if (!value || value == Py_None)
24122  value = NULL;
24123  else
24124  Py_INCREF(value);
24125  if (!tb || tb == Py_None)
24126  tb = NULL;
24127  else {
24128  Py_INCREF(tb);
24129  if (!PyTraceBack_Check(tb)) {
24130  PyErr_SetString(PyExc_TypeError,
24131  "raise: arg 3 must be a traceback or None");
24132  goto raise_error;
24133  }
24134  }
24135  if (PyType_Check(type)) {
24136 #if CYTHON_COMPILING_IN_PYPY
24137  if (!value) {
24138  Py_INCREF(Py_None);
24139  value = Py_None;
24140  }
24141 #endif
24142  PyErr_NormalizeException(&type, &value, &tb);
24143  } else {
24144  if (value) {
24145  PyErr_SetString(PyExc_TypeError,
24146  "instance exception may not have a separate value");
24147  goto raise_error;
24148  }
24149  value = type;
24150  type = (PyObject*) Py_TYPE(type);
24151  Py_INCREF(type);
24152  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
24153  PyErr_SetString(PyExc_TypeError,
24154  "raise: exception class must be a subclass of BaseException");
24155  goto raise_error;
24156  }
24157  }
24158  __Pyx_PyThreadState_assign
24159  __Pyx_ErrRestore(type, value, tb);
24160  return;
24161 raise_error:
24162  Py_XDECREF(value);
24163  Py_XDECREF(type);
24164  Py_XDECREF(tb);
24165  return;
24166 }
24167 #else
24168 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
24169  PyObject* owned_instance = NULL;
24170  if (tb == Py_None) {
24171  tb = 0;
24172  } else if (tb && !PyTraceBack_Check(tb)) {
24173  PyErr_SetString(PyExc_TypeError,
24174  "raise: arg 3 must be a traceback or None");
24175  goto bad;
24176  }
24177  if (value == Py_None)
24178  value = 0;
24179  if (PyExceptionInstance_Check(type)) {
24180  if (value) {
24181  PyErr_SetString(PyExc_TypeError,
24182  "instance exception may not have a separate value");
24183  goto bad;
24184  }
24185  value = type;
24186  type = (PyObject*) Py_TYPE(value);
24187  } else if (PyExceptionClass_Check(type)) {
24188  PyObject *instance_class = NULL;
24189  if (value && PyExceptionInstance_Check(value)) {
24190  instance_class = (PyObject*) Py_TYPE(value);
24191  if (instance_class != type) {
24192  int is_subclass = PyObject_IsSubclass(instance_class, type);
24193  if (!is_subclass) {
24194  instance_class = NULL;
24195  } else if (unlikely(is_subclass == -1)) {
24196  goto bad;
24197  } else {
24198  type = instance_class;
24199  }
24200  }
24201  }
24202  if (!instance_class) {
24203  PyObject *args;
24204  if (!value)
24205  args = PyTuple_New(0);
24206  else if (PyTuple_Check(value)) {
24207  Py_INCREF(value);
24208  args = value;
24209  } else
24210  args = PyTuple_Pack(1, value);
24211  if (!args)
24212  goto bad;
24213  owned_instance = PyObject_Call(type, args, NULL);
24214  Py_DECREF(args);
24215  if (!owned_instance)
24216  goto bad;
24217  value = owned_instance;
24218  if (!PyExceptionInstance_Check(value)) {
24219  PyErr_Format(PyExc_TypeError,
24220  "calling %R should have returned an instance of "
24221  "BaseException, not %R",
24222  type, Py_TYPE(value));
24223  goto bad;
24224  }
24225  }
24226  } else {
24227  PyErr_SetString(PyExc_TypeError,
24228  "raise: exception class must be a subclass of BaseException");
24229  goto bad;
24230  }
24231  if (cause) {
24232  PyObject *fixed_cause;
24233  if (cause == Py_None) {
24234  fixed_cause = NULL;
24235  } else if (PyExceptionClass_Check(cause)) {
24236  fixed_cause = PyObject_CallObject(cause, NULL);
24237  if (fixed_cause == NULL)
24238  goto bad;
24239  } else if (PyExceptionInstance_Check(cause)) {
24240  fixed_cause = cause;
24241  Py_INCREF(fixed_cause);
24242  } else {
24243  PyErr_SetString(PyExc_TypeError,
24244  "exception causes must derive from "
24245  "BaseException");
24246  goto bad;
24247  }
24248  PyException_SetCause(value, fixed_cause);
24249  }
24250  PyErr_SetObject(type, value);
24251  if (tb) {
24252 #if CYTHON_COMPILING_IN_PYPY
24253  PyObject *tmp_type, *tmp_value, *tmp_tb;
24254  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
24255  Py_INCREF(tb);
24256  PyErr_Restore(tmp_type, tmp_value, tb);
24257  Py_XDECREF(tmp_tb);
24258 #else
24259  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24260  PyObject* tmp_tb = tstate->curexc_traceback;
24261  if (tb != tmp_tb) {
24262  Py_INCREF(tb);
24263  tstate->curexc_traceback = tb;
24264  Py_XDECREF(tmp_tb);
24265  }
24266 #endif
24267  }
24268 bad:
24269  Py_XDECREF(owned_instance);
24270  return;
24271 }
24272 #endif
24273 
24274 /* WriteUnraisableException */
24275 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
24276  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
24277  int full_traceback, CYTHON_UNUSED int nogil) {
24278  PyObject *old_exc, *old_val, *old_tb;
24279  PyObject *ctx;
24280  __Pyx_PyThreadState_declare
24281 #ifdef WITH_THREAD
24282  PyGILState_STATE state;
24283  if (nogil)
24284  state = PyGILState_Ensure();
24285 #ifdef _MSC_VER
24286  else state = (PyGILState_STATE)-1;
24287 #endif
24288 #endif
24289  __Pyx_PyThreadState_assign
24290  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
24291  if (full_traceback) {
24292  Py_XINCREF(old_exc);
24293  Py_XINCREF(old_val);
24294  Py_XINCREF(old_tb);
24295  __Pyx_ErrRestore(old_exc, old_val, old_tb);
24296  PyErr_PrintEx(1);
24297  }
24298  #if PY_MAJOR_VERSION < 3
24299  ctx = PyString_FromString(name);
24300  #else
24301  ctx = PyUnicode_FromString(name);
24302  #endif
24303  __Pyx_ErrRestore(old_exc, old_val, old_tb);
24304  if (!ctx) {
24305  PyErr_WriteUnraisable(Py_None);
24306  } else {
24307  PyErr_WriteUnraisable(ctx);
24308  Py_DECREF(ctx);
24309  }
24310 #ifdef WITH_THREAD
24311  if (nogil)
24312  PyGILState_Release(state);
24313 #endif
24314 }
24315 
24316 /* DictGetItem */
24317 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
24318 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
24319  PyObject *value;
24320  value = PyDict_GetItemWithError(d, key);
24321  if (unlikely(!value)) {
24322  if (!PyErr_Occurred()) {
24323  if (unlikely(PyTuple_Check(key))) {
24324  PyObject* args = PyTuple_Pack(1, key);
24325  if (likely(args)) {
24326  PyErr_SetObject(PyExc_KeyError, args);
24327  Py_DECREF(args);
24328  }
24329  } else {
24330  PyErr_SetObject(PyExc_KeyError, key);
24331  }
24332  }
24333  return NULL;
24334  }
24335  Py_INCREF(value);
24336  return value;
24337 }
24338 #endif
24339 
24340 /* RaiseTooManyValuesToUnpack */
24341 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
24342  PyErr_Format(PyExc_ValueError,
24343  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
24344 }
24345 
24346 /* RaiseNeedMoreValuesToUnpack */
24347 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
24348  PyErr_Format(PyExc_ValueError,
24349  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
24350  index, (index == 1) ? "" : "s");
24351 }
24352 
24353 /* RaiseNoneIterError */
24354 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
24355  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
24356 }
24357 
24358 /* PyErrExceptionMatches */
24359 #if CYTHON_FAST_THREAD_STATE
24360 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24361  Py_ssize_t i, n;
24362  n = PyTuple_GET_SIZE(tuple);
24363 #if PY_MAJOR_VERSION >= 3
24364  for (i=0; i<n; i++) {
24365  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
24366  }
24367 #endif
24368  for (i=0; i<n; i++) {
24369  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
24370  }
24371  return 0;
24372 }
24373 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24374  PyObject *exc_type = tstate->curexc_type;
24375  if (exc_type == err) return 1;
24376  if (unlikely(!exc_type)) return 0;
24377  if (unlikely(PyTuple_Check(err)))
24378  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
24379  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
24380 }
24381 #endif
24382 
24383 /* ArgTypeTest */
24384 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
24385 {
24386  if (unlikely(!type)) {
24387  PyErr_SetString(PyExc_SystemError, "Missing type object");
24388  return 0;
24389  }
24390  else if (exact) {
24391  #if PY_MAJOR_VERSION == 2
24392  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
24393  #endif
24394  }
24395  else {
24396  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
24397  }
24398  PyErr_Format(PyExc_TypeError,
24399  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
24400  name, type->tp_name, Py_TYPE(obj)->tp_name);
24401  return 0;
24402 }
24403 
24404 /* BytesEquals */
24405 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
24406 #if CYTHON_COMPILING_IN_PYPY
24407  return PyObject_RichCompareBool(s1, s2, equals);
24408 #else
24409  if (s1 == s2) {
24410  return (equals == Py_EQ);
24411  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
24412  const char *ps1, *ps2;
24413  Py_ssize_t length = PyBytes_GET_SIZE(s1);
24414  if (length != PyBytes_GET_SIZE(s2))
24415  return (equals == Py_NE);
24416  ps1 = PyBytes_AS_STRING(s1);
24417  ps2 = PyBytes_AS_STRING(s2);
24418  if (ps1[0] != ps2[0]) {
24419  return (equals == Py_NE);
24420  } else if (length == 1) {
24421  return (equals == Py_EQ);
24422  } else {
24423  int result;
24424 #if CYTHON_USE_UNICODE_INTERNALS
24425  Py_hash_t hash1, hash2;
24426  hash1 = ((PyBytesObject*)s1)->ob_shash;
24427  hash2 = ((PyBytesObject*)s2)->ob_shash;
24428  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24429  return (equals == Py_NE);
24430  }
24431 #endif
24432  result = memcmp(ps1, ps2, (size_t)length);
24433  return (equals == Py_EQ) ? (result == 0) : (result != 0);
24434  }
24435  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
24436  return (equals == Py_NE);
24437  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
24438  return (equals == Py_NE);
24439  } else {
24440  int result;
24441  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24442  if (!py_result)
24443  return -1;
24444  result = __Pyx_PyObject_IsTrue(py_result);
24445  Py_DECREF(py_result);
24446  return result;
24447  }
24448 #endif
24449 }
24450 
24451 /* UnicodeEquals */
24452 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
24453 #if CYTHON_COMPILING_IN_PYPY
24454  return PyObject_RichCompareBool(s1, s2, equals);
24455 #else
24456 #if PY_MAJOR_VERSION < 3
24457  PyObject* owned_ref = NULL;
24458 #endif
24459  int s1_is_unicode, s2_is_unicode;
24460  if (s1 == s2) {
24461  goto return_eq;
24462  }
24463  s1_is_unicode = PyUnicode_CheckExact(s1);
24464  s2_is_unicode = PyUnicode_CheckExact(s2);
24465 #if PY_MAJOR_VERSION < 3
24466  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
24467  owned_ref = PyUnicode_FromObject(s2);
24468  if (unlikely(!owned_ref))
24469  return -1;
24470  s2 = owned_ref;
24471  s2_is_unicode = 1;
24472  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
24473  owned_ref = PyUnicode_FromObject(s1);
24474  if (unlikely(!owned_ref))
24475  return -1;
24476  s1 = owned_ref;
24477  s1_is_unicode = 1;
24478  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
24479  return __Pyx_PyBytes_Equals(s1, s2, equals);
24480  }
24481 #endif
24482  if (s1_is_unicode & s2_is_unicode) {
24483  Py_ssize_t length;
24484  int kind;
24485  void *data1, *data2;
24486  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
24487  return -1;
24488  length = __Pyx_PyUnicode_GET_LENGTH(s1);
24489  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
24490  goto return_ne;
24491  }
24492 #if CYTHON_USE_UNICODE_INTERNALS
24493  {
24494  Py_hash_t hash1, hash2;
24495  #if CYTHON_PEP393_ENABLED
24496  hash1 = ((PyASCIIObject*)s1)->hash;
24497  hash2 = ((PyASCIIObject*)s2)->hash;
24498  #else
24499  hash1 = ((PyUnicodeObject*)s1)->hash;
24500  hash2 = ((PyUnicodeObject*)s2)->hash;
24501  #endif
24502  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24503  goto return_ne;
24504  }
24505  }
24506 #endif
24507  kind = __Pyx_PyUnicode_KIND(s1);
24508  if (kind != __Pyx_PyUnicode_KIND(s2)) {
24509  goto return_ne;
24510  }
24511  data1 = __Pyx_PyUnicode_DATA(s1);
24512  data2 = __Pyx_PyUnicode_DATA(s2);
24513  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
24514  goto return_ne;
24515  } else if (length == 1) {
24516  goto return_eq;
24517  } else {
24518  int result = memcmp(data1, data2, (size_t)(length * kind));
24519  #if PY_MAJOR_VERSION < 3
24520  Py_XDECREF(owned_ref);
24521  #endif
24522  return (equals == Py_EQ) ? (result == 0) : (result != 0);
24523  }
24524  } else if ((s1 == Py_None) & s2_is_unicode) {
24525  goto return_ne;
24526  } else if ((s2 == Py_None) & s1_is_unicode) {
24527  goto return_ne;
24528  } else {
24529  int result;
24530  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24531  #if PY_MAJOR_VERSION < 3
24532  Py_XDECREF(owned_ref);
24533  #endif
24534  if (!py_result)
24535  return -1;
24536  result = __Pyx_PyObject_IsTrue(py_result);
24537  Py_DECREF(py_result);
24538  return result;
24539  }
24540 return_eq:
24541  #if PY_MAJOR_VERSION < 3
24542  Py_XDECREF(owned_ref);
24543  #endif
24544  return (equals == Py_EQ);
24545 return_ne:
24546  #if PY_MAJOR_VERSION < 3
24547  Py_XDECREF(owned_ref);
24548  #endif
24549  return (equals == Py_NE);
24550 #endif
24551 }
24552 
24553 /* None */
24554 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
24555  Py_ssize_t q = a / b;
24556  Py_ssize_t r = a - q*b;
24557  q -= ((r != 0) & ((r ^ b) < 0));
24558  return q;
24559 }
24560 
24561 /* GetAttr */
24562 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
24563 #if CYTHON_USE_TYPE_SLOTS
24564 #if PY_MAJOR_VERSION >= 3
24565  if (likely(PyUnicode_Check(n)))
24566 #else
24567  if (likely(PyString_Check(n)))
24568 #endif
24569  return __Pyx_PyObject_GetAttrStr(o, n);
24570 #endif
24571  return PyObject_GetAttr(o, n);
24572 }
24573 
24574 /* decode_c_string */
24575 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
24576  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
24577  const char* encoding, const char* errors,
24578  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
24579  Py_ssize_t length;
24580  if (unlikely((start < 0) | (stop < 0))) {
24581  size_t slen = strlen(cstring);
24582  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
24583  PyErr_SetString(PyExc_OverflowError,
24584  "c-string too long to convert to Python");
24585  return NULL;
24586  }
24587  length = (Py_ssize_t) slen;
24588  if (start < 0) {
24589  start += length;
24590  if (start < 0)
24591  start = 0;
24592  }
24593  if (stop < 0)
24594  stop += length;
24595  }
24596  if (unlikely(stop <= start))
24597  return __Pyx_NewRef(__pyx_empty_unicode);
24598  length = stop - start;
24599  cstring += start;
24600  if (decode_func) {
24601  return decode_func(cstring, length, errors);
24602  } else {
24603  return PyUnicode_Decode(cstring, length, encoding, errors);
24604  }
24605 }
24606 
24607 /* GetAttr3 */
24608 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
24609  __Pyx_PyThreadState_declare
24610  __Pyx_PyThreadState_assign
24611  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24612  return NULL;
24613  __Pyx_PyErr_Clear();
24614  Py_INCREF(d);
24615  return d;
24616 }
24617 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
24618  PyObject *r = __Pyx_GetAttr(o, n);
24619  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
24620 }
24621 
24622 /* PyDictVersioning */
24623 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
24624 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
24625  PyObject *dict = Py_TYPE(obj)->tp_dict;
24626  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
24627 }
24628 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
24629  PyObject **dictptr = NULL;
24630  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
24631  if (offset) {
24632 #if CYTHON_COMPILING_IN_CPYTHON
24633  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
24634 #else
24635  dictptr = _PyObject_GetDictPtr(obj);
24636 #endif
24637  }
24638  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
24639 }
24640 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
24641  PyObject *dict = Py_TYPE(obj)->tp_dict;
24642  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
24643  return 0;
24644  return obj_dict_version == __Pyx_get_object_dict_version(obj);
24645 }
24646 #endif
24647 
24648 /* GetModuleGlobalName */
24649 #if CYTHON_USE_DICT_VERSIONS
24650 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
24651 #else
24652 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
24653 #endif
24654 {
24655  PyObject *result;
24656 #if !CYTHON_AVOID_BORROWED_REFS
24657 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24658  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24659  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24660  if (likely(result)) {
24661  return __Pyx_NewRef(result);
24662  } else if (unlikely(PyErr_Occurred())) {
24663  return NULL;
24664  }
24665 #else
24666  result = PyDict_GetItem(__pyx_d, name);
24667  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24668  if (likely(result)) {
24669  return __Pyx_NewRef(result);
24670  }
24671 #endif
24672 #else
24673  result = PyObject_GetItem(__pyx_d, name);
24674  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24675  if (likely(result)) {
24676  return __Pyx_NewRef(result);
24677  }
24678  PyErr_Clear();
24679 #endif
24680  return __Pyx_GetBuiltinName(name);
24681 }
24682 
24683 /* SwapException */
24684 #if CYTHON_FAST_THREAD_STATE
24685 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24686  PyObject *tmp_type, *tmp_value, *tmp_tb;
24687  #if CYTHON_USE_EXC_INFO_STACK
24688  _PyErr_StackItem *exc_info = tstate->exc_info;
24689  tmp_type = exc_info->exc_type;
24690  tmp_value = exc_info->exc_value;
24691  tmp_tb = exc_info->exc_traceback;
24692  exc_info->exc_type = *type;
24693  exc_info->exc_value = *value;
24694  exc_info->exc_traceback = *tb;
24695  #else
24696  tmp_type = tstate->exc_type;
24697  tmp_value = tstate->exc_value;
24698  tmp_tb = tstate->exc_traceback;
24699  tstate->exc_type = *type;
24700  tstate->exc_value = *value;
24701  tstate->exc_traceback = *tb;
24702  #endif
24703  *type = tmp_type;
24704  *value = tmp_value;
24705  *tb = tmp_tb;
24706 }
24707 #else
24708 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
24709  PyObject *tmp_type, *tmp_value, *tmp_tb;
24710  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
24711  PyErr_SetExcInfo(*type, *value, *tb);
24712  *type = tmp_type;
24713  *value = tmp_value;
24714  *tb = tmp_tb;
24715 }
24716 #endif
24717 
24718 /* Import */
24719 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
24720  PyObject *empty_list = 0;
24721  PyObject *module = 0;
24722  PyObject *global_dict = 0;
24723  PyObject *empty_dict = 0;
24724  PyObject *list;
24725  #if PY_MAJOR_VERSION < 3
24726  PyObject *py_import;
24727  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
24728  if (!py_import)
24729  goto bad;
24730  #endif
24731  if (from_list)
24732  list = from_list;
24733  else {
24734  empty_list = PyList_New(0);
24735  if (!empty_list)
24736  goto bad;
24737  list = empty_list;
24738  }
24739  global_dict = PyModule_GetDict(__pyx_m);
24740  if (!global_dict)
24741  goto bad;
24742  empty_dict = PyDict_New();
24743  if (!empty_dict)
24744  goto bad;
24745  {
24746  #if PY_MAJOR_VERSION >= 3
24747  if (level == -1) {
24748  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
24749  module = PyImport_ImportModuleLevelObject(
24750  name, global_dict, empty_dict, list, 1);
24751  if (!module) {
24752  if (!PyErr_ExceptionMatches(PyExc_ImportError))
24753  goto bad;
24754  PyErr_Clear();
24755  }
24756  }
24757  level = 0;
24758  }
24759  #endif
24760  if (!module) {
24761  #if PY_MAJOR_VERSION < 3
24762  PyObject *py_level = PyInt_FromLong(level);
24763  if (!py_level)
24764  goto bad;
24765  module = PyObject_CallFunctionObjArgs(py_import,
24766  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
24767  Py_DECREF(py_level);
24768  #else
24769  module = PyImport_ImportModuleLevelObject(
24770  name, global_dict, empty_dict, list, level);
24771  #endif
24772  }
24773  }
24774 bad:
24775  #if PY_MAJOR_VERSION < 3
24776  Py_XDECREF(py_import);
24777  #endif
24778  Py_XDECREF(empty_list);
24779  Py_XDECREF(empty_dict);
24780  return module;
24781 }
24782 
24783 /* FastTypeChecks */
24784 #if CYTHON_COMPILING_IN_CPYTHON
24785 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
24786  while (a) {
24787  a = a->tp_base;
24788  if (a == b)
24789  return 1;
24790  }
24791  return b == &PyBaseObject_Type;
24792 }
24793 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
24794  PyObject *mro;
24795  if (a == b) return 1;
24796  mro = a->tp_mro;
24797  if (likely(mro)) {
24798  Py_ssize_t i, n;
24799  n = PyTuple_GET_SIZE(mro);
24800  for (i = 0; i < n; i++) {
24801  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
24802  return 1;
24803  }
24804  return 0;
24805  }
24806  return __Pyx_InBases(a, b);
24807 }
24808 #if PY_MAJOR_VERSION == 2
24809 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
24810  PyObject *exception, *value, *tb;
24811  int res;
24812  __Pyx_PyThreadState_declare
24813  __Pyx_PyThreadState_assign
24814  __Pyx_ErrFetch(&exception, &value, &tb);
24815  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
24816  if (unlikely(res == -1)) {
24817  PyErr_WriteUnraisable(err);
24818  res = 0;
24819  }
24820  if (!res) {
24821  res = PyObject_IsSubclass(err, exc_type2);
24822  if (unlikely(res == -1)) {
24823  PyErr_WriteUnraisable(err);
24824  res = 0;
24825  }
24826  }
24827  __Pyx_ErrRestore(exception, value, tb);
24828  return res;
24829 }
24830 #else
24831 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
24832  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
24833  if (!res) {
24834  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
24835  }
24836  return res;
24837 }
24838 #endif
24839 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24840  Py_ssize_t i, n;
24841  assert(PyExceptionClass_Check(exc_type));
24842  n = PyTuple_GET_SIZE(tuple);
24843 #if PY_MAJOR_VERSION >= 3
24844  for (i=0; i<n; i++) {
24845  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
24846  }
24847 #endif
24848  for (i=0; i<n; i++) {
24849  PyObject *t = PyTuple_GET_ITEM(tuple, i);
24850  #if PY_MAJOR_VERSION < 3
24851  if (likely(exc_type == t)) return 1;
24852  #endif
24853  if (likely(PyExceptionClass_Check(t))) {
24854  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
24855  } else {
24856  }
24857  }
24858  return 0;
24859 }
24860 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
24861  if (likely(err == exc_type)) return 1;
24862  if (likely(PyExceptionClass_Check(err))) {
24863  if (likely(PyExceptionClass_Check(exc_type))) {
24864  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
24865  } else if (likely(PyTuple_Check(exc_type))) {
24866  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
24867  } else {
24868  }
24869  }
24870  return PyErr_GivenExceptionMatches(err, exc_type);
24871 }
24872 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
24873  assert(PyExceptionClass_Check(exc_type1));
24874  assert(PyExceptionClass_Check(exc_type2));
24875  if (likely(err == exc_type1 || err == exc_type2)) return 1;
24876  if (likely(PyExceptionClass_Check(err))) {
24877  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
24878  }
24879  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
24880 }
24881 #endif
24882 
24883 /* None */
24884 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
24885  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
24886 }
24887 
24888 /* None */
24889 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
24890  long q = a / b;
24891  long r = a - q*b;
24892  q -= ((r != 0) & ((r ^ b) < 0));
24893  return q;
24894 }
24895 
24896 /* ImportFrom */
24897 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
24898  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
24899  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
24900  PyErr_Format(PyExc_ImportError,
24901  #if PY_MAJOR_VERSION < 3
24902  "cannot import name %.230s", PyString_AS_STRING(name));
24903  #else
24904  "cannot import name %S", name);
24905  #endif
24906  }
24907  return value;
24908 }
24909 
24910 /* HasAttr */
24911 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
24912  PyObject *r;
24913  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
24914  PyErr_SetString(PyExc_TypeError,
24915  "hasattr(): attribute name must be string");
24916  return -1;
24917  }
24918  r = __Pyx_GetAttr(o, n);
24919  if (unlikely(!r)) {
24920  PyErr_Clear();
24921  return 0;
24922  } else {
24923  Py_DECREF(r);
24924  return 1;
24925  }
24926 }
24927 
24928 /* PyObject_GenericGetAttrNoDict */
24929 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
24930 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
24931  PyErr_Format(PyExc_AttributeError,
24932 #if PY_MAJOR_VERSION >= 3
24933  "'%.50s' object has no attribute '%U'",
24934  tp->tp_name, attr_name);
24935 #else
24936  "'%.50s' object has no attribute '%.400s'",
24937  tp->tp_name, PyString_AS_STRING(attr_name));
24938 #endif
24939  return NULL;
24940 }
24941 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
24942  PyObject *descr;
24943  PyTypeObject *tp = Py_TYPE(obj);
24944  if (unlikely(!PyString_Check(attr_name))) {
24945  return PyObject_GenericGetAttr(obj, attr_name);
24946  }
24947  assert(!tp->tp_dictoffset);
24948  descr = _PyType_Lookup(tp, attr_name);
24949  if (unlikely(!descr)) {
24950  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
24951  }
24952  Py_INCREF(descr);
24953  #if PY_MAJOR_VERSION < 3
24954  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
24955  #endif
24956  {
24957  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
24958  if (unlikely(f)) {
24959  PyObject *res = f(descr, obj, (PyObject *)tp);
24960  Py_DECREF(descr);
24961  return res;
24962  }
24963  }
24964  return descr;
24965 }
24966 #endif
24967 
24968 /* PyObject_GenericGetAttr */
24969 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
24970 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
24971  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
24972  return PyObject_GenericGetAttr(obj, attr_name);
24973  }
24974  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
24975 }
24976 #endif
24977 
24978 /* PyObjectGetAttrStrNoError */
24979 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
24980  __Pyx_PyThreadState_declare
24981  __Pyx_PyThreadState_assign
24982  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24983  __Pyx_PyErr_Clear();
24984 }
24985 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
24986  PyObject *result;
24987 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
24988  PyTypeObject* tp = Py_TYPE(obj);
24989  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
24990  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
24991  }
24992 #endif
24993  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
24994  if (unlikely(!result)) {
24995  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
24996  }
24997  return result;
24998 }
24999 
25000 /* SetupReduce */
25001 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
25002  int ret;
25003  PyObject *name_attr;
25004  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
25005  if (likely(name_attr)) {
25006  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
25007  } else {
25008  ret = -1;
25009  }
25010  if (unlikely(ret < 0)) {
25011  PyErr_Clear();
25012  ret = 0;
25013  }
25014  Py_XDECREF(name_attr);
25015  return ret;
25016 }
25017 static int __Pyx_setup_reduce(PyObject* type_obj) {
25018  int ret = 0;
25019  PyObject *object_reduce = NULL;
25020  PyObject *object_reduce_ex = NULL;
25021  PyObject *reduce = NULL;
25022  PyObject *reduce_ex = NULL;
25023  PyObject *reduce_cython = NULL;
25024  PyObject *setstate = NULL;
25025  PyObject *setstate_cython = NULL;
25026 #if CYTHON_USE_PYTYPE_LOOKUP
25027  if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
25028 #else
25029  if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
25030 #endif
25031 #if CYTHON_USE_PYTYPE_LOOKUP
25032  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
25033 #else
25034  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
25035 #endif
25036  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
25037  if (reduce_ex == object_reduce_ex) {
25038 #if CYTHON_USE_PYTYPE_LOOKUP
25039  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
25040 #else
25041  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
25042 #endif
25043  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
25044  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
25045  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
25046  if (likely(reduce_cython)) {
25047  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25048  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25049  } else if (reduce == object_reduce || PyErr_Occurred()) {
25050  goto __PYX_BAD;
25051  }
25052  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
25053  if (!setstate) PyErr_Clear();
25054  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
25055  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
25056  if (likely(setstate_cython)) {
25057  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25058  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25059  } else if (!setstate || PyErr_Occurred()) {
25060  goto __PYX_BAD;
25061  }
25062  }
25063  PyType_Modified((PyTypeObject*)type_obj);
25064  }
25065  }
25066  goto __PYX_GOOD;
25067 __PYX_BAD:
25068  if (!PyErr_Occurred())
25069  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
25070  ret = -1;
25071 __PYX_GOOD:
25072 #if !CYTHON_USE_PYTYPE_LOOKUP
25073  Py_XDECREF(object_reduce);
25074  Py_XDECREF(object_reduce_ex);
25075 #endif
25076  Py_XDECREF(reduce);
25077  Py_XDECREF(reduce_ex);
25078  Py_XDECREF(reduce_cython);
25079  Py_XDECREF(setstate);
25080  Py_XDECREF(setstate_cython);
25081  return ret;
25082 }
25083 
25084 /* SetVTable */
25085 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
25086 #if PY_VERSION_HEX >= 0x02070000
25087  PyObject *ob = PyCapsule_New(vtable, 0, 0);
25088 #else
25089  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
25090 #endif
25091  if (!ob)
25092  goto bad;
25093  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
25094  goto bad;
25095  Py_DECREF(ob);
25096  return 0;
25097 bad:
25098  Py_XDECREF(ob);
25099  return -1;
25100 }
25101 
25102 /* TypeImport */
25103 #ifndef __PYX_HAVE_RT_ImportType
25104 #define __PYX_HAVE_RT_ImportType
25105 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
25106  size_t size, enum __Pyx_ImportType_CheckSize check_size)
25107 {
25108  PyObject *result = 0;
25109  char warning[200];
25110  Py_ssize_t basicsize;
25111 #ifdef Py_LIMITED_API
25112  PyObject *py_basicsize;
25113 #endif
25114  result = PyObject_GetAttrString(module, class_name);
25115  if (!result)
25116  goto bad;
25117  if (!PyType_Check(result)) {
25118  PyErr_Format(PyExc_TypeError,
25119  "%.200s.%.200s is not a type object",
25120  module_name, class_name);
25121  goto bad;
25122  }
25123 #ifndef Py_LIMITED_API
25124  basicsize = ((PyTypeObject *)result)->tp_basicsize;
25125 #else
25126  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
25127  if (!py_basicsize)
25128  goto bad;
25129  basicsize = PyLong_AsSsize_t(py_basicsize);
25130  Py_DECREF(py_basicsize);
25131  py_basicsize = 0;
25132  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
25133  goto bad;
25134 #endif
25135  if ((size_t)basicsize < size) {
25136  PyErr_Format(PyExc_ValueError,
25137  "%.200s.%.200s size changed, may indicate binary incompatibility. "
25138  "Expected %zd from C header, got %zd from PyObject",
25139  module_name, class_name, size, basicsize);
25140  goto bad;
25141  }
25142  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
25143  PyErr_Format(PyExc_ValueError,
25144  "%.200s.%.200s size changed, may indicate binary incompatibility. "
25145  "Expected %zd from C header, got %zd from PyObject",
25146  module_name, class_name, size, basicsize);
25147  goto bad;
25148  }
25149  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
25150  PyOS_snprintf(warning, sizeof(warning),
25151  "%s.%s size changed, may indicate binary incompatibility. "
25152  "Expected %zd from C header, got %zd from PyObject",
25153  module_name, class_name, size, basicsize);
25154  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
25155  }
25156  return (PyTypeObject *)result;
25157 bad:
25158  Py_XDECREF(result);
25159  return NULL;
25160 }
25161 #endif
25162 
25163 /* CalculateMetaclass */
25164 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
25165  Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
25166  for (i=0; i < nbases; i++) {
25167  PyTypeObject *tmptype;
25168  PyObject *tmp = PyTuple_GET_ITEM(bases, i);
25169  tmptype = Py_TYPE(tmp);
25170 #if PY_MAJOR_VERSION < 3
25171  if (tmptype == &PyClass_Type)
25172  continue;
25173 #endif
25174  if (!metaclass) {
25175  metaclass = tmptype;
25176  continue;
25177  }
25178  if (PyType_IsSubtype(metaclass, tmptype))
25179  continue;
25180  if (PyType_IsSubtype(tmptype, metaclass)) {
25181  metaclass = tmptype;
25182  continue;
25183  }
25184  PyErr_SetString(PyExc_TypeError,
25185  "metaclass conflict: "
25186  "the metaclass of a derived class "
25187  "must be a (non-strict) subclass "
25188  "of the metaclasses of all its bases");
25189  return NULL;
25190  }
25191  if (!metaclass) {
25192 #if PY_MAJOR_VERSION < 3
25193  metaclass = &PyClass_Type;
25194 #else
25195  metaclass = &PyType_Type;
25196 #endif
25197  }
25198  Py_INCREF((PyObject*) metaclass);
25199  return (PyObject*) metaclass;
25200 }
25201 
25202 /* FetchCommonType */
25203 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
25204  PyObject* fake_module;
25205  PyTypeObject* cached_type = NULL;
25206  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
25207  if (!fake_module) return NULL;
25208  Py_INCREF(fake_module);
25209  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
25210  if (cached_type) {
25211  if (!PyType_Check((PyObject*)cached_type)) {
25212  PyErr_Format(PyExc_TypeError,
25213  "Shared Cython type %.200s is not a type object",
25214  type->tp_name);
25215  goto bad;
25216  }
25217  if (cached_type->tp_basicsize != type->tp_basicsize) {
25218  PyErr_Format(PyExc_TypeError,
25219  "Shared Cython type %.200s has the wrong size, try recompiling",
25220  type->tp_name);
25221  goto bad;
25222  }
25223  } else {
25224  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
25225  PyErr_Clear();
25226  if (PyType_Ready(type) < 0) goto bad;
25227  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
25228  goto bad;
25229  Py_INCREF(type);
25230  cached_type = type;
25231  }
25232 done:
25233  Py_DECREF(fake_module);
25234  return cached_type;
25235 bad:
25236  Py_XDECREF(cached_type);
25237  cached_type = NULL;
25238  goto done;
25239 }
25240 
25241 /* CythonFunctionShared */
25242 #include <structmember.h>
25243 static PyObject *
25244 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
25245 {
25246  if (unlikely(op->func_doc == NULL)) {
25247  if (op->func.m_ml->ml_doc) {
25248 #if PY_MAJOR_VERSION >= 3
25249  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
25250 #else
25251  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
25252 #endif
25253  if (unlikely(op->func_doc == NULL))
25254  return NULL;
25255  } else {
25256  Py_INCREF(Py_None);
25257  return Py_None;
25258  }
25259  }
25260  Py_INCREF(op->func_doc);
25261  return op->func_doc;
25262 }
25263 static int
25264 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25265 {
25266  PyObject *tmp = op->func_doc;
25267  if (value == NULL) {
25268  value = Py_None;
25269  }
25270  Py_INCREF(value);
25271  op->func_doc = value;
25272  Py_XDECREF(tmp);
25273  return 0;
25274 }
25275 static PyObject *
25276 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25277 {
25278  if (unlikely(op->func_name == NULL)) {
25279 #if PY_MAJOR_VERSION >= 3
25280  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
25281 #else
25282  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
25283 #endif
25284  if (unlikely(op->func_name == NULL))
25285  return NULL;
25286  }
25287  Py_INCREF(op->func_name);
25288  return op->func_name;
25289 }
25290 static int
25291 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25292 {
25293  PyObject *tmp;
25294 #if PY_MAJOR_VERSION >= 3
25295  if (unlikely(value == NULL || !PyUnicode_Check(value)))
25296 #else
25297  if (unlikely(value == NULL || !PyString_Check(value)))
25298 #endif
25299  {
25300  PyErr_SetString(PyExc_TypeError,
25301  "__name__ must be set to a string object");
25302  return -1;
25303  }
25304  tmp = op->func_name;
25305  Py_INCREF(value);
25306  op->func_name = value;
25307  Py_XDECREF(tmp);
25308  return 0;
25309 }
25310 static PyObject *
25311 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25312 {
25313  Py_INCREF(op->func_qualname);
25314  return op->func_qualname;
25315 }
25316 static int
25317 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25318 {
25319  PyObject *tmp;
25320 #if PY_MAJOR_VERSION >= 3
25321  if (unlikely(value == NULL || !PyUnicode_Check(value)))
25322 #else
25323  if (unlikely(value == NULL || !PyString_Check(value)))
25324 #endif
25325  {
25326  PyErr_SetString(PyExc_TypeError,
25327  "__qualname__ must be set to a string object");
25328  return -1;
25329  }
25330  tmp = op->func_qualname;
25331  Py_INCREF(value);
25332  op->func_qualname = value;
25333  Py_XDECREF(tmp);
25334  return 0;
25335 }
25336 static PyObject *
25337 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
25338 {
25339  PyObject *self;
25340  self = m->func_closure;
25341  if (self == NULL)
25342  self = Py_None;
25343  Py_INCREF(self);
25344  return self;
25345 }
25346 static PyObject *
25347 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25348 {
25349  if (unlikely(op->func_dict == NULL)) {
25350  op->func_dict = PyDict_New();
25351  if (unlikely(op->func_dict == NULL))
25352  return NULL;
25353  }
25354  Py_INCREF(op->func_dict);
25355  return op->func_dict;
25356 }
25357 static int
25358 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25359 {
25360  PyObject *tmp;
25361  if (unlikely(value == NULL)) {
25362  PyErr_SetString(PyExc_TypeError,
25363  "function's dictionary may not be deleted");
25364  return -1;
25365  }
25366  if (unlikely(!PyDict_Check(value))) {
25367  PyErr_SetString(PyExc_TypeError,
25368  "setting function's dictionary to a non-dict");
25369  return -1;
25370  }
25371  tmp = op->func_dict;
25372  Py_INCREF(value);
25373  op->func_dict = value;
25374  Py_XDECREF(tmp);
25375  return 0;
25376 }
25377 static PyObject *
25378 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25379 {
25380  Py_INCREF(op->func_globals);
25381  return op->func_globals;
25382 }
25383 static PyObject *
25384 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25385 {
25386  Py_INCREF(Py_None);
25387  return Py_None;
25388 }
25389 static PyObject *
25390 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25391 {
25392  PyObject* result = (op->func_code) ? op->func_code : Py_None;
25393  Py_INCREF(result);
25394  return result;
25395 }
25396 static int
25397 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
25398  int result = 0;
25399  PyObject *res = op->defaults_getter((PyObject *) op);
25400  if (unlikely(!res))
25401  return -1;
25402  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25403  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
25404  Py_INCREF(op->defaults_tuple);
25405  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
25406  Py_INCREF(op->defaults_kwdict);
25407  #else
25408  op->defaults_tuple = PySequence_ITEM(res, 0);
25409  if (unlikely(!op->defaults_tuple)) result = -1;
25410  else {
25411  op->defaults_kwdict = PySequence_ITEM(res, 1);
25412  if (unlikely(!op->defaults_kwdict)) result = -1;
25413  }
25414  #endif
25415  Py_DECREF(res);
25416  return result;
25417 }
25418 static int
25419 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
25420  PyObject* tmp;
25421  if (!value) {
25422  value = Py_None;
25423  } else if (value != Py_None && !PyTuple_Check(value)) {
25424  PyErr_SetString(PyExc_TypeError,
25425  "__defaults__ must be set to a tuple object");
25426  return -1;
25427  }
25428  Py_INCREF(value);
25429  tmp = op->defaults_tuple;
25430  op->defaults_tuple = value;
25431  Py_XDECREF(tmp);
25432  return 0;
25433 }
25434 static PyObject *
25435 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
25436  PyObject* result = op->defaults_tuple;
25437  if (unlikely(!result)) {
25438  if (op->defaults_getter) {
25439  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
25440  result = op->defaults_tuple;
25441  } else {
25442  result = Py_None;
25443  }
25444  }
25445  Py_INCREF(result);
25446  return result;
25447 }
25448 static int
25449 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
25450  PyObject* tmp;
25451  if (!value) {
25452  value = Py_None;
25453  } else if (value != Py_None && !PyDict_Check(value)) {
25454  PyErr_SetString(PyExc_TypeError,
25455  "__kwdefaults__ must be set to a dict object");
25456  return -1;
25457  }
25458  Py_INCREF(value);
25459  tmp = op->defaults_kwdict;
25460  op->defaults_kwdict = value;
25461  Py_XDECREF(tmp);
25462  return 0;
25463 }
25464 static PyObject *
25465 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
25466  PyObject* result = op->defaults_kwdict;
25467  if (unlikely(!result)) {
25468  if (op->defaults_getter) {
25469  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
25470  result = op->defaults_kwdict;
25471  } else {
25472  result = Py_None;
25473  }
25474  }
25475  Py_INCREF(result);
25476  return result;
25477 }
25478 static int
25479 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
25480  PyObject* tmp;
25481  if (!value || value == Py_None) {
25482  value = NULL;
25483  } else if (!PyDict_Check(value)) {
25484  PyErr_SetString(PyExc_TypeError,
25485  "__annotations__ must be set to a dict object");
25486  return -1;
25487  }
25488  Py_XINCREF(value);
25489  tmp = op->func_annotations;
25490  op->func_annotations = value;
25491  Py_XDECREF(tmp);
25492  return 0;
25493 }
25494 static PyObject *
25495 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
25496  PyObject* result = op->func_annotations;
25497  if (unlikely(!result)) {
25498  result = PyDict_New();
25499  if (unlikely(!result)) return NULL;
25500  op->func_annotations = result;
25501  }
25502  Py_INCREF(result);
25503  return result;
25504 }
25505 static PyGetSetDef __pyx_CyFunction_getsets[] = {
25506  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25507  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25508  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25509  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25510  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
25511  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
25512  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25513  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25514  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25515  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25516  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25517  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25518  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25519  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25520  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25521  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25522  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
25523  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
25524  {0, 0, 0, 0, 0}
25525 };
25526 static PyMemberDef __pyx_CyFunction_members[] = {
25527  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
25528  {0, 0, 0, 0, 0}
25529 };
25530 static PyObject *
25531 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
25532 {
25533 #if PY_MAJOR_VERSION >= 3
25534  return PyUnicode_FromString(m->func.m_ml->ml_name);
25535 #else
25536  return PyString_FromString(m->func.m_ml->ml_name);
25537 #endif
25538 }
25539 static PyMethodDef __pyx_CyFunction_methods[] = {
25540  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
25541  {0, 0, 0, 0}
25542 };
25543 #if PY_VERSION_HEX < 0x030500A0
25544 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
25545 #else
25546 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
25547 #endif
25548 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
25549  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25550  if (unlikely(op == NULL))
25551  return NULL;
25552  op->flags = flags;
25553  __Pyx_CyFunction_weakreflist(op) = NULL;
25554  op->func.m_ml = ml;
25555  op->func.m_self = (PyObject *) op;
25556  Py_XINCREF(closure);
25557  op->func_closure = closure;
25558  Py_XINCREF(module);
25559  op->func.m_module = module;
25560  op->func_dict = NULL;
25561  op->func_name = NULL;
25562  Py_INCREF(qualname);
25563  op->func_qualname = qualname;
25564  op->func_doc = NULL;
25565  op->func_classobj = NULL;
25566  op->func_globals = globals;
25567  Py_INCREF(op->func_globals);
25568  Py_XINCREF(code);
25569  op->func_code = code;
25570  op->defaults_pyobjects = 0;
25571  op->defaults_size = 0;
25572  op->defaults = NULL;
25573  op->defaults_tuple = NULL;
25574  op->defaults_kwdict = NULL;
25575  op->defaults_getter = NULL;
25576  op->func_annotations = NULL;
25577  return (PyObject *) op;
25578 }
25579 static int
25580 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
25581 {
25582  Py_CLEAR(m->func_closure);
25583  Py_CLEAR(m->func.m_module);
25584  Py_CLEAR(m->func_dict);
25585  Py_CLEAR(m->func_name);
25586  Py_CLEAR(m->func_qualname);
25587  Py_CLEAR(m->func_doc);
25588  Py_CLEAR(m->func_globals);
25589  Py_CLEAR(m->func_code);
25590  Py_CLEAR(m->func_classobj);
25591  Py_CLEAR(m->defaults_tuple);
25592  Py_CLEAR(m->defaults_kwdict);
25593  Py_CLEAR(m->func_annotations);
25594  if (m->defaults) {
25595  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25596  int i;
25597  for (i = 0; i < m->defaults_pyobjects; i++)
25598  Py_XDECREF(pydefaults[i]);
25599  PyObject_Free(m->defaults);
25600  m->defaults = NULL;
25601  }
25602  return 0;
25603 }
25604 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
25605 {
25606  if (__Pyx_CyFunction_weakreflist(m) != NULL)
25607  PyObject_ClearWeakRefs((PyObject *) m);
25608  __Pyx_CyFunction_clear(m);
25609  PyObject_GC_Del(m);
25610 }
25611 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
25612 {
25613  PyObject_GC_UnTrack(m);
25614  __Pyx__CyFunction_dealloc(m);
25615 }
25616 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
25617 {
25618  Py_VISIT(m->func_closure);
25619  Py_VISIT(m->func.m_module);
25620  Py_VISIT(m->func_dict);
25621  Py_VISIT(m->func_name);
25622  Py_VISIT(m->func_qualname);
25623  Py_VISIT(m->func_doc);
25624  Py_VISIT(m->func_globals);
25625  Py_VISIT(m->func_code);
25626  Py_VISIT(m->func_classobj);
25627  Py_VISIT(m->defaults_tuple);
25628  Py_VISIT(m->defaults_kwdict);
25629  if (m->defaults) {
25630  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25631  int i;
25632  for (i = 0; i < m->defaults_pyobjects; i++)
25633  Py_VISIT(pydefaults[i]);
25634  }
25635  return 0;
25636 }
25637 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
25638 {
25639 #if PY_MAJOR_VERSION < 3
25640  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25641  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
25642  Py_INCREF(func);
25643  return func;
25644  }
25645  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
25646  if (type == NULL)
25647  type = (PyObject *)(Py_TYPE(obj));
25648  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
25649  }
25650  if (obj == Py_None)
25651  obj = NULL;
25652 #endif
25653  return __Pyx_PyMethod_New(func, obj, type);
25654 }
25655 static PyObject*
25656 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
25657 {
25658 #if PY_MAJOR_VERSION >= 3
25659  return PyUnicode_FromFormat("<cyfunction %U at %p>",
25660  op->func_qualname, (void *)op);
25661 #else
25662  return PyString_FromFormat("<cyfunction %s at %p>",
25663  PyString_AsString(op->func_qualname), (void *)op);
25664 #endif
25665 }
25666 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
25667  PyCFunctionObject* f = (PyCFunctionObject*)func;
25668  PyCFunction meth = f->m_ml->ml_meth;
25669  Py_ssize_t size;
25670  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
25671  case METH_VARARGS:
25672  if (likely(kw == NULL || PyDict_Size(kw) == 0))
25673  return (*meth)(self, arg);
25674  break;
25675  case METH_VARARGS | METH_KEYWORDS:
25676  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
25677  case METH_NOARGS:
25678  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25679  size = PyTuple_GET_SIZE(arg);
25680  if (likely(size == 0))
25681  return (*meth)(self, NULL);
25682  PyErr_Format(PyExc_TypeError,
25683  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
25684  f->m_ml->ml_name, size);
25685  return NULL;
25686  }
25687  break;
25688  case METH_O:
25689  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25690  size = PyTuple_GET_SIZE(arg);
25691  if (likely(size == 1)) {
25692  PyObject *result, *arg0;
25693  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25694  arg0 = PyTuple_GET_ITEM(arg, 0);
25695  #else
25696  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
25697  #endif
25698  result = (*meth)(self, arg0);
25699  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
25700  Py_DECREF(arg0);
25701  #endif
25702  return result;
25703  }
25704  PyErr_Format(PyExc_TypeError,
25705  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
25706  f->m_ml->ml_name, size);
25707  return NULL;
25708  }
25709  break;
25710  default:
25711  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
25712  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
25713  "longer supported!");
25714  return NULL;
25715  }
25716  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
25717  f->m_ml->ml_name);
25718  return NULL;
25719 }
25720 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
25721  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
25722 }
25723 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
25724  PyObject *result;
25725  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
25726  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
25727  Py_ssize_t argc;
25728  PyObject *new_args;
25729  PyObject *self;
25730  argc = PyTuple_GET_SIZE(args);
25731  new_args = PyTuple_GetSlice(args, 1, argc);
25732  if (unlikely(!new_args))
25733  return NULL;
25734  self = PyTuple_GetItem(args, 0);
25735  if (unlikely(!self)) {
25736  Py_DECREF(new_args);
25737  return NULL;
25738  }
25739  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
25740  Py_DECREF(new_args);
25741  } else {
25742  result = __Pyx_CyFunction_Call(func, args, kw);
25743  }
25744  return result;
25745 }
25746 static PyTypeObject __pyx_CyFunctionType_type = {
25747  PyVarObject_HEAD_INIT(0, 0)
25748  "cython_function_or_method",
25749  sizeof(__pyx_CyFunctionObject),
25750  0,
25751  (destructor) __Pyx_CyFunction_dealloc,
25752  0,
25753  0,
25754  0,
25755 #if PY_MAJOR_VERSION < 3
25756  0,
25757 #else
25758  0,
25759 #endif
25760  (reprfunc) __Pyx_CyFunction_repr,
25761  0,
25762  0,
25763  0,
25764  0,
25765  __Pyx_CyFunction_CallAsMethod,
25766  0,
25767  0,
25768  0,
25769  0,
25770  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
25771  0,
25772  (traverseproc) __Pyx_CyFunction_traverse,
25773  (inquiry) __Pyx_CyFunction_clear,
25774  0,
25775 #if PY_VERSION_HEX < 0x030500A0
25776  offsetof(__pyx_CyFunctionObject, func_weakreflist),
25777 #else
25778  offsetof(PyCFunctionObject, m_weakreflist),
25779 #endif
25780  0,
25781  0,
25782  __pyx_CyFunction_methods,
25783  __pyx_CyFunction_members,
25784  __pyx_CyFunction_getsets,
25785  0,
25786  0,
25787  __Pyx_CyFunction_descr_get,
25788  0,
25789  offsetof(__pyx_CyFunctionObject, func_dict),
25790  0,
25791  0,
25792  0,
25793  0,
25794  0,
25795  0,
25796  0,
25797  0,
25798  0,
25799  0,
25800  0,
25801  0,
25802 #if PY_VERSION_HEX >= 0x030400a1
25803  0,
25804 #endif
25805 #if PY_VERSION_HEX >= 0x030800b1
25806  0,
25807 #endif
25808 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25809  0,
25810 #endif
25811 };
25812 static int __pyx_CyFunction_init(void) {
25813  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
25814  if (unlikely(__pyx_CyFunctionType == NULL)) {
25815  return -1;
25816  }
25817  return 0;
25818 }
25819 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
25820  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25821  m->defaults = PyObject_Malloc(size);
25822  if (unlikely(!m->defaults))
25823  return PyErr_NoMemory();
25824  memset(m->defaults, 0, size);
25825  m->defaults_pyobjects = pyobjects;
25826  m->defaults_size = size;
25827  return m->defaults;
25828 }
25829 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
25830  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25831  m->defaults_tuple = tuple;
25832  Py_INCREF(tuple);
25833 }
25834 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
25835  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25836  m->defaults_kwdict = dict;
25837  Py_INCREF(dict);
25838 }
25839 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
25840  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25841  m->func_annotations = dict;
25842  Py_INCREF(dict);
25843 }
25844 
25845 /* CythonFunction */
25846 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
25847  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25848  PyObject *op = __Pyx_CyFunction_Init(
25849  PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
25850  ml, flags, qualname, closure, module, globals, code
25851  );
25852  if (likely(op)) {
25853  PyObject_GC_Track(op);
25854  }
25855  return op;
25856 }
25857 
25858 /* Py3ClassCreate */
25859 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
25860  PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
25861  PyObject *ns;
25862  if (metaclass) {
25863  PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
25864  if (prep) {
25865  PyObject *pargs = PyTuple_Pack(2, name, bases);
25866  if (unlikely(!pargs)) {
25867  Py_DECREF(prep);
25868  return NULL;
25869  }
25870  ns = PyObject_Call(prep, pargs, mkw);
25871  Py_DECREF(prep);
25872  Py_DECREF(pargs);
25873  } else {
25874  if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
25875  return NULL;
25876  PyErr_Clear();
25877  ns = PyDict_New();
25878  }
25879  } else {
25880  ns = PyDict_New();
25881  }
25882  if (unlikely(!ns))
25883  return NULL;
25884  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
25885  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
25886  if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
25887  return ns;
25888 bad:
25889  Py_DECREF(ns);
25890  return NULL;
25891 }
25892 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
25893  PyObject *dict, PyObject *mkw,
25894  int calculate_metaclass, int allow_py2_metaclass) {
25895  PyObject *result, *margs;
25896  PyObject *owned_metaclass = NULL;
25897  if (allow_py2_metaclass) {
25898  owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
25899  if (owned_metaclass) {
25900  metaclass = owned_metaclass;
25901  } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
25902  PyErr_Clear();
25903  } else {
25904  return NULL;
25905  }
25906  }
25907  if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
25908  metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
25909  Py_XDECREF(owned_metaclass);
25910  if (unlikely(!metaclass))
25911  return NULL;
25912  owned_metaclass = metaclass;
25913  }
25914  margs = PyTuple_Pack(3, name, bases, dict);
25915  if (unlikely(!margs)) {
25916  result = NULL;
25917  } else {
25918  result = PyObject_Call(metaclass, margs, mkw);
25919  Py_DECREF(margs);
25920  }
25921  Py_XDECREF(owned_metaclass);
25922  return result;
25923 }
25924 
25925 /* CLineInTraceback */
25926 #ifndef CYTHON_CLINE_IN_TRACEBACK
25927 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
25928  PyObject *use_cline;
25929  PyObject *ptype, *pvalue, *ptraceback;
25930 #if CYTHON_COMPILING_IN_CPYTHON
25931  PyObject **cython_runtime_dict;
25932 #endif
25933  if (unlikely(!__pyx_cython_runtime)) {
25934  return c_line;
25935  }
25936  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25937 #if CYTHON_COMPILING_IN_CPYTHON
25938  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
25939  if (likely(cython_runtime_dict)) {
25940  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
25941  use_cline, *cython_runtime_dict,
25942  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
25943  } else
25944 #endif
25945  {
25946  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
25947  if (use_cline_obj) {
25948  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
25949  Py_DECREF(use_cline_obj);
25950  } else {
25951  PyErr_Clear();
25952  use_cline = NULL;
25953  }
25954  }
25955  if (!use_cline) {
25956  c_line = 0;
25957  PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
25958  }
25959  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
25960  c_line = 0;
25961  }
25962  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25963  return c_line;
25964 }
25965 #endif
25966 
25967 /* CodeObjectCache */
25968 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
25969  int start = 0, mid = 0, end = count - 1;
25970  if (end >= 0 && code_line > entries[end].code_line) {
25971  return count;
25972  }
25973  while (start < end) {
25974  mid = start + (end - start) / 2;
25975  if (code_line < entries[mid].code_line) {
25976  end = mid;
25977  } else if (code_line > entries[mid].code_line) {
25978  start = mid + 1;
25979  } else {
25980  return mid;
25981  }
25982  }
25983  if (code_line <= entries[mid].code_line) {
25984  return mid;
25985  } else {
25986  return mid + 1;
25987  }
25988 }
25989 static PyCodeObject *__pyx_find_code_object(int code_line) {
25990  PyCodeObject* code_object;
25991  int pos;
25992  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
25993  return NULL;
25994  }
25995  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25996  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
25997  return NULL;
25998  }
25999  code_object = __pyx_code_cache.entries[pos].code_object;
26000  Py_INCREF(code_object);
26001  return code_object;
26002 }
26003 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
26004  int pos, i;
26005  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
26006  if (unlikely(!code_line)) {
26007  return;
26008  }
26009  if (unlikely(!entries)) {
26010  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
26011  if (likely(entries)) {
26012  __pyx_code_cache.entries = entries;
26013  __pyx_code_cache.max_count = 64;
26014  __pyx_code_cache.count = 1;
26015  entries[0].code_line = code_line;
26016  entries[0].code_object = code_object;
26017  Py_INCREF(code_object);
26018  }
26019  return;
26020  }
26021  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26022  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
26023  PyCodeObject* tmp = entries[pos].code_object;
26024  entries[pos].code_object = code_object;
26025  Py_DECREF(tmp);
26026  return;
26027  }
26028  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26029  int new_max = __pyx_code_cache.max_count + 64;
26030  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26031  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
26032  if (unlikely(!entries)) {
26033  return;
26034  }
26035  __pyx_code_cache.entries = entries;
26036  __pyx_code_cache.max_count = new_max;
26037  }
26038  for (i=__pyx_code_cache.count; i>pos; i--) {
26039  entries[i] = entries[i-1];
26040  }
26041  entries[pos].code_line = code_line;
26042  entries[pos].code_object = code_object;
26043  __pyx_code_cache.count++;
26044  Py_INCREF(code_object);
26045 }
26046 
26047 /* AddTraceback */
26048 #include "compile.h"
26049 #include "frameobject.h"
26050 #include "traceback.h"
26051 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26052  const char *funcname, int c_line,
26053  int py_line, const char *filename) {
26054  PyCodeObject *py_code = 0;
26055  PyObject *py_srcfile = 0;
26056  PyObject *py_funcname = 0;
26057  #if PY_MAJOR_VERSION < 3
26058  py_srcfile = PyString_FromString(filename);
26059  #else
26060  py_srcfile = PyUnicode_FromString(filename);
26061  #endif
26062  if (!py_srcfile) goto bad;
26063  if (c_line) {
26064  #if PY_MAJOR_VERSION < 3
26065  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26066  #else
26067  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26068  #endif
26069  }
26070  else {
26071  #if PY_MAJOR_VERSION < 3
26072  py_funcname = PyString_FromString(funcname);
26073  #else
26074  py_funcname = PyUnicode_FromString(funcname);
26075  #endif
26076  }
26077  if (!py_funcname) goto bad;
26078  py_code = __Pyx_PyCode_New(
26079  0,
26080  0,
26081  0,
26082  0,
26083  0,
26084  __pyx_empty_bytes, /*PyObject *code,*/
26085  __pyx_empty_tuple, /*PyObject *consts,*/
26086  __pyx_empty_tuple, /*PyObject *names,*/
26087  __pyx_empty_tuple, /*PyObject *varnames,*/
26088  __pyx_empty_tuple, /*PyObject *freevars,*/
26089  __pyx_empty_tuple, /*PyObject *cellvars,*/
26090  py_srcfile, /*PyObject *filename,*/
26091  py_funcname, /*PyObject *name,*/
26092  py_line,
26093  __pyx_empty_bytes /*PyObject *lnotab*/
26094  );
26095  Py_DECREF(py_srcfile);
26096  Py_DECREF(py_funcname);
26097  return py_code;
26098 bad:
26099  Py_XDECREF(py_srcfile);
26100  Py_XDECREF(py_funcname);
26101  return NULL;
26102 }
26103 static void __Pyx_AddTraceback(const char *funcname, int c_line,
26104  int py_line, const char *filename) {
26105  PyCodeObject *py_code = 0;
26106  PyFrameObject *py_frame = 0;
26107  PyThreadState *tstate = __Pyx_PyThreadState_Current;
26108  if (c_line) {
26109  c_line = __Pyx_CLineForTraceback(tstate, c_line);
26110  }
26111  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
26112  if (!py_code) {
26113  py_code = __Pyx_CreateCodeObjectForTraceback(
26114  funcname, c_line, py_line, filename);
26115  if (!py_code) goto bad;
26116  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
26117  }
26118  py_frame = PyFrame_New(
26119  tstate, /*PyThreadState *tstate,*/
26120  py_code, /*PyCodeObject *code,*/
26121  __pyx_d, /*PyObject *globals,*/
26122  0 /*PyObject *locals*/
26123  );
26124  if (!py_frame) goto bad;
26125  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
26126  PyTraceBack_Here(py_frame);
26127 bad:
26128  Py_XDECREF(py_code);
26129  Py_XDECREF(py_frame);
26130 }
26131 
26132 #if PY_MAJOR_VERSION < 3
26133 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
26134  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
26135  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
26136  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
26137  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26138  return -1;
26139 }
26140 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26141  PyObject *obj = view->obj;
26142  if (!obj) return;
26143  if (PyObject_CheckBuffer(obj)) {
26144  PyBuffer_Release(view);
26145  return;
26146  }
26147  if ((0)) {}
26148  view->obj = NULL;
26149  Py_DECREF(obj);
26150 }
26151 #endif
26152 
26153 
26154 /* MemviewSliceIsContig */
26155 static int
26156 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
26157 {
26158  int i, index, step, start;
26159  Py_ssize_t itemsize = mvs.memview->view.itemsize;
26160  if (order == 'F') {
26161  step = 1;
26162  start = 0;
26163  } else {
26164  step = -1;
26165  start = ndim - 1;
26166  }
26167  for (i = 0; i < ndim; i++) {
26168  index = start + step * i;
26169  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
26170  return 0;
26171  itemsize *= mvs.shape[index];
26172  }
26173  return 1;
26174 }
26175 
26176 /* OverlappingSlices */
26177 static void
26178 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
26179  void **out_start, void **out_end,
26180  int ndim, size_t itemsize)
26181 {
26182  char *start, *end;
26183  int i;
26184  start = end = slice->data;
26185  for (i = 0; i < ndim; i++) {
26186  Py_ssize_t stride = slice->strides[i];
26187  Py_ssize_t extent = slice->shape[i];
26188  if (extent == 0) {
26189  *out_start = *out_end = start;
26190  return;
26191  } else {
26192  if (stride > 0)
26193  end += stride * (extent - 1);
26194  else
26195  start += stride * (extent - 1);
26196  }
26197  }
26198  *out_start = start;
26199  *out_end = end + itemsize;
26200 }
26201 static int
26202 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
26203  __Pyx_memviewslice *slice2,
26204  int ndim, size_t itemsize)
26205 {
26206  void *start1, *end1, *start2, *end2;
26207  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
26208  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
26209  return (start1 < end2) && (start2 < end1);
26210 }
26211 
26212 /* Capsule */
26213 static CYTHON_INLINE PyObject *
26214 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
26215 {
26216  PyObject *cobj;
26217 #if PY_VERSION_HEX >= 0x02070000
26218  cobj = PyCapsule_New(p, sig, NULL);
26219 #else
26220  cobj = PyCObject_FromVoidPtr(p, NULL);
26221 #endif
26222  return cobj;
26223 }
26224 
26225 /* CIntFromPyVerify */
26226 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
26227  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
26228 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
26229  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
26230 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
26231  {\
26232  func_type value = func_value;\
26233  if (sizeof(target_type) < sizeof(func_type)) {\
26234  if (unlikely(value != (func_type) (target_type) value)) {\
26235  func_type zero = 0;\
26236  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
26237  return (target_type) -1;\
26238  if (is_unsigned && unlikely(value < zero))\
26239  goto raise_neg_overflow;\
26240  else\
26241  goto raise_overflow;\
26242  }\
26243  }\
26244  return (target_type) value;\
26245  }
26246 
26247 /* IsLittleEndian */
26248 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
26249 {
26250  union {
26251  uint32_t u32;
26252  uint8_t u8[4];
26253  } S;
26254  S.u32 = 0x01020304;
26255  return S.u8[0] == 4;
26256 }
26257 
26258 /* BufferFormatCheck */
26259 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
26260  __Pyx_BufFmt_StackElem* stack,
26261  __Pyx_TypeInfo* type) {
26262  stack[0].field = &ctx->root;
26263  stack[0].parent_offset = 0;
26264  ctx->root.type = type;
26265  ctx->root.name = "buffer dtype";
26266  ctx->root.offset = 0;
26267  ctx->head = stack;
26268  ctx->head->field = &ctx->root;
26269  ctx->fmt_offset = 0;
26270  ctx->head->parent_offset = 0;
26271  ctx->new_packmode = '@';
26272  ctx->enc_packmode = '@';
26273  ctx->new_count = 1;
26274  ctx->enc_count = 0;
26275  ctx->enc_type = 0;
26276  ctx->is_complex = 0;
26277  ctx->is_valid_array = 0;
26278  ctx->struct_alignment = 0;
26279  while (type->typegroup == 'S') {
26280  ++ctx->head;
26281  ctx->head->field = type->fields;
26282  ctx->head->parent_offset = 0;
26283  type = type->fields->type;
26284  }
26285 }
26286 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
26287  int count;
26288  const char* t = *ts;
26289  if (*t < '0' || *t > '9') {
26290  return -1;
26291  } else {
26292  count = *t++ - '0';
26293  while (*t >= '0' && *t <= '9') {
26294  count *= 10;
26295  count += *t++ - '0';
26296  }
26297  }
26298  *ts = t;
26299  return count;
26300 }
26301 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
26302  int number = __Pyx_BufFmt_ParseNumber(ts);
26303  if (number == -1)
26304  PyErr_Format(PyExc_ValueError,\
26305  "Does not understand character buffer dtype format string ('%c')", **ts);
26306  return number;
26307 }
26308 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
26309  PyErr_Format(PyExc_ValueError,
26310  "Unexpected format string character: '%c'", ch);
26311 }
26312 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
26313  switch (ch) {
26314  case '?': return "'bool'";
26315  case 'c': return "'char'";
26316  case 'b': return "'signed char'";
26317  case 'B': return "'unsigned char'";
26318  case 'h': return "'short'";
26319  case 'H': return "'unsigned short'";
26320  case 'i': return "'int'";
26321  case 'I': return "'unsigned int'";
26322  case 'l': return "'long'";
26323  case 'L': return "'unsigned long'";
26324  case 'q': return "'long long'";
26325  case 'Q': return "'unsigned long long'";
26326  case 'f': return (is_complex ? "'complex float'" : "'float'");
26327  case 'd': return (is_complex ? "'complex double'" : "'double'");
26328  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
26329  case 'T': return "a struct";
26330  case 'O': return "Python object";
26331  case 'P': return "a pointer";
26332  case 's': case 'p': return "a string";
26333  case 0: return "end";
26334  default: return "unparseable format string";
26335  }
26336 }
26337 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
26338  switch (ch) {
26339  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26340  case 'h': case 'H': return 2;
26341  case 'i': case 'I': case 'l': case 'L': return 4;
26342  case 'q': case 'Q': return 8;
26343  case 'f': return (is_complex ? 8 : 4);
26344  case 'd': return (is_complex ? 16 : 8);
26345  case 'g': {
26346  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
26347  return 0;
26348  }
26349  case 'O': case 'P': return sizeof(void*);
26350  default:
26351  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26352  return 0;
26353  }
26354 }
26355 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
26356  switch (ch) {
26357  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26358  case 'h': case 'H': return sizeof(short);
26359  case 'i': case 'I': return sizeof(int);
26360  case 'l': case 'L': return sizeof(long);
26361  #ifdef HAVE_LONG_LONG
26362  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
26363  #endif
26364  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
26365  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
26366  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
26367  case 'O': case 'P': return sizeof(void*);
26368  default: {
26369  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26370  return 0;
26371  }
26372  }
26373 }
26374 typedef struct { char c; short x; } __Pyx_st_short;
26375 typedef struct { char c; int x; } __Pyx_st_int;
26376 typedef struct { char c; long x; } __Pyx_st_long;
26377 typedef struct { char c; float x; } __Pyx_st_float;
26378 typedef struct { char c; double x; } __Pyx_st_double;
26379 typedef struct { char c; long double x; } __Pyx_st_longdouble;
26380 typedef struct { char c; void *x; } __Pyx_st_void_p;
26381 #ifdef HAVE_LONG_LONG
26382 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
26383 #endif
26384 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
26385  switch (ch) {
26386  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26387  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
26388  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
26389  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
26390 #ifdef HAVE_LONG_LONG
26391  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
26392 #endif
26393  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
26394  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
26395  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
26396  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
26397  default:
26398  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26399  return 0;
26400  }
26401 }
26402 /* These are for computing the padding at the end of the struct to align
26403  on the first member of the struct. This will probably the same as above,
26404  but we don't have any guarantees.
26405  */
26406 typedef struct { short x; char c; } __Pyx_pad_short;
26407 typedef struct { int x; char c; } __Pyx_pad_int;
26408 typedef struct { long x; char c; } __Pyx_pad_long;
26409 typedef struct { float x; char c; } __Pyx_pad_float;
26410 typedef struct { double x; char c; } __Pyx_pad_double;
26411 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
26412 typedef struct { void *x; char c; } __Pyx_pad_void_p;
26413 #ifdef HAVE_LONG_LONG
26414 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
26415 #endif
26416 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
26417  switch (ch) {
26418  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26419  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
26420  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
26421  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
26422 #ifdef HAVE_LONG_LONG
26423  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
26424 #endif
26425  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
26426  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
26427  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
26428  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
26429  default:
26430  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26431  return 0;
26432  }
26433 }
26434 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
26435  switch (ch) {
26436  case 'c':
26437  return 'H';
26438  case 'b': case 'h': case 'i':
26439  case 'l': case 'q': case 's': case 'p':
26440  return 'I';
26441  case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
26442  return 'U';
26443  case 'f': case 'd': case 'g':
26444  return (is_complex ? 'C' : 'R');
26445  case 'O':
26446  return 'O';
26447  case 'P':
26448  return 'P';
26449  default: {
26450  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26451  return 0;
26452  }
26453  }
26454 }
26455 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
26456  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
26457  const char* expected;
26458  const char* quote;
26459  if (ctx->head == NULL) {
26460  expected = "end";
26461  quote = "";
26462  } else {
26463  expected = ctx->head->field->type->name;
26464  quote = "'";
26465  }
26466  PyErr_Format(PyExc_ValueError,
26467  "Buffer dtype mismatch, expected %s%s%s but got %s",
26468  quote, expected, quote,
26469  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
26470  } else {
26471  __Pyx_StructField* field = ctx->head->field;
26472  __Pyx_StructField* parent = (ctx->head - 1)->field;
26473  PyErr_Format(PyExc_ValueError,
26474  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
26475  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
26476  parent->type->name, field->name);
26477  }
26478 }
26479 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
26480  char group;
26481  size_t size, offset, arraysize = 1;
26482  if (ctx->enc_type == 0) return 0;
26483  if (ctx->head->field->type->arraysize[0]) {
26484  int i, ndim = 0;
26485  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
26486  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
26487  ndim = 1;
26488  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
26489  PyErr_Format(PyExc_ValueError,
26490  "Expected a dimension of size %zu, got %zu",
26491  ctx->head->field->type->arraysize[0], ctx->enc_count);
26492  return -1;
26493  }
26494  }
26495  if (!ctx->is_valid_array) {
26496  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
26497  ctx->head->field->type->ndim, ndim);
26498  return -1;
26499  }
26500  for (i = 0; i < ctx->head->field->type->ndim; i++) {
26501  arraysize *= ctx->head->field->type->arraysize[i];
26502  }
26503  ctx->is_valid_array = 0;
26504  ctx->enc_count = 1;
26505  }
26506  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
26507  do {
26508  __Pyx_StructField* field = ctx->head->field;
26509  __Pyx_TypeInfo* type = field->type;
26510  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
26511  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
26512  } else {
26513  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
26514  }
26515  if (ctx->enc_packmode == '@') {
26516  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
26517  size_t align_mod_offset;
26518  if (align_at == 0) return -1;
26519  align_mod_offset = ctx->fmt_offset % align_at;
26520  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
26521  if (ctx->struct_alignment == 0)
26522  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
26523  ctx->is_complex);
26524  }
26525  if (type->size != size || type->typegroup != group) {
26526  if (type->typegroup == 'C' && type->fields != NULL) {
26527  size_t parent_offset = ctx->head->parent_offset + field->offset;
26528  ++ctx->head;
26529  ctx->head->field = type->fields;
26530  ctx->head->parent_offset = parent_offset;
26531  continue;
26532  }
26533  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
26534  } else {
26535  __Pyx_BufFmt_RaiseExpected(ctx);
26536  return -1;
26537  }
26538  }
26539  offset = ctx->head->parent_offset + field->offset;
26540  if (ctx->fmt_offset != offset) {
26541  PyErr_Format(PyExc_ValueError,
26542  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
26543  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
26544  return -1;
26545  }
26546  ctx->fmt_offset += size;
26547  if (arraysize)
26548  ctx->fmt_offset += (arraysize - 1) * size;
26549  --ctx->enc_count;
26550  while (1) {
26551  if (field == &ctx->root) {
26552  ctx->head = NULL;
26553  if (ctx->enc_count != 0) {
26554  __Pyx_BufFmt_RaiseExpected(ctx);
26555  return -1;
26556  }
26557  break;
26558  }
26559  ctx->head->field = ++field;
26560  if (field->type == NULL) {
26561  --ctx->head;
26562  field = ctx->head->field;
26563  continue;
26564  } else if (field->type->typegroup == 'S') {
26565  size_t parent_offset = ctx->head->parent_offset + field->offset;
26566  if (field->type->fields->type == NULL) continue;
26567  field = field->type->fields;
26568  ++ctx->head;
26569  ctx->head->field = field;
26570  ctx->head->parent_offset = parent_offset;
26571  break;
26572  } else {
26573  break;
26574  }
26575  }
26576  } while (ctx->enc_count);
26577  ctx->enc_type = 0;
26578  ctx->is_complex = 0;
26579  return 0;
26580 }
26581 static PyObject *
26582 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
26583 {
26584  const char *ts = *tsp;
26585  int i = 0, number, ndim;
26586  ++ts;
26587  if (ctx->new_count != 1) {
26588  PyErr_SetString(PyExc_ValueError,
26589  "Cannot handle repeated arrays in format string");
26590  return NULL;
26591  }
26592  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26593  ndim = ctx->head->field->type->ndim;
26594  while (*ts && *ts != ')') {
26595  switch (*ts) {
26596  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
26597  default: break;
26598  }
26599  number = __Pyx_BufFmt_ExpectNumber(&ts);
26600  if (number == -1) return NULL;
26601  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
26602  return PyErr_Format(PyExc_ValueError,
26603  "Expected a dimension of size %zu, got %d",
26604  ctx->head->field->type->arraysize[i], number);
26605  if (*ts != ',' && *ts != ')')
26606  return PyErr_Format(PyExc_ValueError,
26607  "Expected a comma in format string, got '%c'", *ts);
26608  if (*ts == ',') ts++;
26609  i++;
26610  }
26611  if (i != ndim)
26612  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
26613  ctx->head->field->type->ndim, i);
26614  if (!*ts) {
26615  PyErr_SetString(PyExc_ValueError,
26616  "Unexpected end of format string, expected ')'");
26617  return NULL;
26618  }
26619  ctx->is_valid_array = 1;
26620  ctx->new_count = 1;
26621  *tsp = ++ts;
26622  return Py_None;
26623 }
26624 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
26625  int got_Z = 0;
26626  while (1) {
26627  switch(*ts) {
26628  case 0:
26629  if (ctx->enc_type != 0 && ctx->head == NULL) {
26630  __Pyx_BufFmt_RaiseExpected(ctx);
26631  return NULL;
26632  }
26633  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26634  if (ctx->head != NULL) {
26635  __Pyx_BufFmt_RaiseExpected(ctx);
26636  return NULL;
26637  }
26638  return ts;
26639  case ' ':
26640  case '\r':
26641  case '\n':
26642  ++ts;
26643  break;
26644  case '<':
26645  if (!__Pyx_Is_Little_Endian()) {
26646  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
26647  return NULL;
26648  }
26649  ctx->new_packmode = '=';
26650  ++ts;
26651  break;
26652  case '>':
26653  case '!':
26654  if (__Pyx_Is_Little_Endian()) {
26655  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
26656  return NULL;
26657  }
26658  ctx->new_packmode = '=';
26659  ++ts;
26660  break;
26661  case '=':
26662  case '@':
26663  case '^':
26664  ctx->new_packmode = *ts++;
26665  break;
26666  case 'T':
26667  {
26668  const char* ts_after_sub;
26669  size_t i, struct_count = ctx->new_count;
26670  size_t struct_alignment = ctx->struct_alignment;
26671  ctx->new_count = 1;
26672  ++ts;
26673  if (*ts != '{') {
26674  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
26675  return NULL;
26676  }
26677  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26678  ctx->enc_type = 0;
26679  ctx->enc_count = 0;
26680  ctx->struct_alignment = 0;
26681  ++ts;
26682  ts_after_sub = ts;
26683  for (i = 0; i != struct_count; ++i) {
26684  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
26685  if (!ts_after_sub) return NULL;
26686  }
26687  ts = ts_after_sub;
26688  if (struct_alignment) ctx->struct_alignment = struct_alignment;
26689  }
26690  break;
26691  case '}':
26692  {
26693  size_t alignment = ctx->struct_alignment;
26694  ++ts;
26695  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26696  ctx->enc_type = 0;
26697  if (alignment && ctx->fmt_offset % alignment) {
26698  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
26699  }
26700  }
26701  return ts;
26702  case 'x':
26703  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26704  ctx->fmt_offset += ctx->new_count;
26705  ctx->new_count = 1;
26706  ctx->enc_count = 0;
26707  ctx->enc_type = 0;
26708  ctx->enc_packmode = ctx->new_packmode;
26709  ++ts;
26710  break;
26711  case 'Z':
26712  got_Z = 1;
26713  ++ts;
26714  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
26715  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
26716  return NULL;
26717  }
26718  CYTHON_FALLTHROUGH;
26719  case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
26720  case 'l': case 'L': case 'q': case 'Q':
26721  case 'f': case 'd': case 'g':
26722  case 'O': case 'p':
26723  if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
26724  (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
26725  ctx->enc_count += ctx->new_count;
26726  ctx->new_count = 1;
26727  got_Z = 0;
26728  ++ts;
26729  break;
26730  }
26731  CYTHON_FALLTHROUGH;
26732  case 's':
26733  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26734  ctx->enc_count = ctx->new_count;
26735  ctx->enc_packmode = ctx->new_packmode;
26736  ctx->enc_type = *ts;
26737  ctx->is_complex = got_Z;
26738  ++ts;
26739  ctx->new_count = 1;
26740  got_Z = 0;
26741  break;
26742  case ':':
26743  ++ts;
26744  while(*ts != ':') ++ts;
26745  ++ts;
26746  break;
26747  case '(':
26748  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
26749  break;
26750  default:
26751  {
26752  int number = __Pyx_BufFmt_ExpectNumber(&ts);
26753  if (number == -1) return NULL;
26754  ctx->new_count = (size_t)number;
26755  }
26756  }
26757  }
26758 }
26759 
26760 /* TypeInfoCompare */
26761  static int
26762 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
26763 {
26764  int i;
26765  if (!a || !b)
26766  return 0;
26767  if (a == b)
26768  return 1;
26769  if (a->size != b->size || a->typegroup != b->typegroup ||
26770  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
26771  if (a->typegroup == 'H' || b->typegroup == 'H') {
26772  return a->size == b->size;
26773  } else {
26774  return 0;
26775  }
26776  }
26777  if (a->ndim) {
26778  for (i = 0; i < a->ndim; i++)
26779  if (a->arraysize[i] != b->arraysize[i])
26780  return 0;
26781  }
26782  if (a->typegroup == 'S') {
26783  if (a->flags != b->flags)
26784  return 0;
26785  if (a->fields || b->fields) {
26786  if (!(a->fields && b->fields))
26787  return 0;
26788  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
26789  __Pyx_StructField *field_a = a->fields + i;
26790  __Pyx_StructField *field_b = b->fields + i;
26791  if (field_a->offset != field_b->offset ||
26792  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
26793  return 0;
26794  }
26795  return !a->fields[i].type && !b->fields[i].type;
26796  }
26797  }
26798  return 1;
26799 }
26800 
26801 /* MemviewSliceValidateAndInit */
26802  static int
26803 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
26804 {
26805  if (buf->shape[dim] <= 1)
26806  return 1;
26807  if (buf->strides) {
26808  if (spec & __Pyx_MEMVIEW_CONTIG) {
26809  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
26810  if (unlikely(buf->strides[dim] != sizeof(void *))) {
26811  PyErr_Format(PyExc_ValueError,
26812  "Buffer is not indirectly contiguous "
26813  "in dimension %d.", dim);
26814  goto fail;
26815  }
26816  } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
26817  PyErr_SetString(PyExc_ValueError,
26818  "Buffer and memoryview are not contiguous "
26819  "in the same dimension.");
26820  goto fail;
26821  }
26822  }
26823  if (spec & __Pyx_MEMVIEW_FOLLOW) {
26824  Py_ssize_t stride = buf->strides[dim];
26825  if (stride < 0)
26826  stride = -stride;
26827  if (unlikely(stride < buf->itemsize)) {
26828  PyErr_SetString(PyExc_ValueError,
26829  "Buffer and memoryview are not contiguous "
26830  "in the same dimension.");
26831  goto fail;
26832  }
26833  }
26834  } else {
26835  if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
26836  PyErr_Format(PyExc_ValueError,
26837  "C-contiguous buffer is not contiguous in "
26838  "dimension %d", dim);
26839  goto fail;
26840  } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
26841  PyErr_Format(PyExc_ValueError,
26842  "C-contiguous buffer is not indirect in "
26843  "dimension %d", dim);
26844  goto fail;
26845  } else if (unlikely(buf->suboffsets)) {
26846  PyErr_SetString(PyExc_ValueError,
26847  "Buffer exposes suboffsets but no strides");
26848  goto fail;
26849  }
26850  }
26851  return 1;
26852 fail:
26853  return 0;
26854 }
26855 static int
26856 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
26857 {
26858  if (spec & __Pyx_MEMVIEW_DIRECT) {
26859  if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
26860  PyErr_Format(PyExc_ValueError,
26861  "Buffer not compatible with direct access "
26862  "in dimension %d.", dim);
26863  goto fail;
26864  }
26865  }
26866  if (spec & __Pyx_MEMVIEW_PTR) {
26867  if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
26868  PyErr_Format(PyExc_ValueError,
26869  "Buffer is not indirectly accessible "
26870  "in dimension %d.", dim);
26871  goto fail;
26872  }
26873  }
26874  return 1;
26875 fail:
26876  return 0;
26877 }
26878 static int
26879 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
26880 {
26881  int i;
26882  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
26883  Py_ssize_t stride = 1;
26884  for (i = 0; i < ndim; i++) {
26885  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
26886  PyErr_SetString(PyExc_ValueError,
26887  "Buffer not fortran contiguous.");
26888  goto fail;
26889  }
26890  stride = stride * buf->shape[i];
26891  }
26892  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
26893  Py_ssize_t stride = 1;
26894  for (i = ndim - 1; i >- 1; i--) {
26895  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
26896  PyErr_SetString(PyExc_ValueError,
26897  "Buffer not C contiguous.");
26898  goto fail;
26899  }
26900  stride = stride * buf->shape[i];
26901  }
26902  }
26903  return 1;
26904 fail:
26905  return 0;
26906 }
26907 static int __Pyx_ValidateAndInit_memviewslice(
26908  int *axes_specs,
26909  int c_or_f_flag,
26910  int buf_flags,
26911  int ndim,
26912  __Pyx_TypeInfo *dtype,
26913  __Pyx_BufFmt_StackElem stack[],
26914  __Pyx_memviewslice *memviewslice,
26915  PyObject *original_obj)
26916 {
26917  struct __pyx_memoryview_obj *memview, *new_memview;
26918  __Pyx_RefNannyDeclarations
26919  Py_buffer *buf;
26920  int i, spec = 0, retval = -1;
26921  __Pyx_BufFmt_Context ctx;
26922  int from_memoryview = __pyx_memoryview_check(original_obj);
26923  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
26924  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
26925  original_obj)->typeinfo)) {
26926  memview = (struct __pyx_memoryview_obj *) original_obj;
26927  new_memview = NULL;
26928  } else {
26929  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
26930  original_obj, buf_flags, 0, dtype);
26931  new_memview = memview;
26932  if (unlikely(!memview))
26933  goto fail;
26934  }
26935  buf = &memview->view;
26936  if (unlikely(buf->ndim != ndim)) {
26937  PyErr_Format(PyExc_ValueError,
26938  "Buffer has wrong number of dimensions (expected %d, got %d)",
26939  ndim, buf->ndim);
26940  goto fail;
26941  }
26942  if (new_memview) {
26943  __Pyx_BufFmt_Init(&ctx, stack, dtype);
26944  if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
26945  }
26946  if (unlikely((unsigned) buf->itemsize != dtype->size)) {
26947  PyErr_Format(PyExc_ValueError,
26948  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
26949  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
26950  buf->itemsize,
26951  (buf->itemsize > 1) ? "s" : "",
26952  dtype->name,
26953  dtype->size,
26954  (dtype->size > 1) ? "s" : "");
26955  goto fail;
26956  }
26957  if (buf->len > 0) {
26958  for (i = 0; i < ndim; i++) {
26959  spec = axes_specs[i];
26960  if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
26961  goto fail;
26962  if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
26963  goto fail;
26964  }
26965  if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
26966  goto fail;
26967  }
26968  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
26969  new_memview != NULL) == -1)) {
26970  goto fail;
26971  }
26972  retval = 0;
26973  goto no_fail;
26974 fail:
26975  Py_XDECREF(new_memview);
26976  retval = -1;
26977 no_fail:
26978  __Pyx_RefNannyFinishContext();
26979  return retval;
26980 }
26981 
26982 /* ObjectToMemviewSlice */
26983  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj, int writable_flag) {
26984  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26985  __Pyx_BufFmt_StackElem stack[1];
26986  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
26987  int retcode;
26988  if (obj == Py_None) {
26989  result.memview = (struct __pyx_memoryview_obj *) Py_None;
26990  return result;
26991  }
26992  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
26993  PyBUF_RECORDS_RO | writable_flag, 1,
26994  &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack,
26995  &result, obj);
26996  if (unlikely(retcode == -1))
26997  goto __pyx_fail;
26998  return result;
26999 __pyx_fail:
27000  result.memview = NULL;
27001  result.data = NULL;
27002  return result;
27003 }
27004 
27005 /* ObjectToMemviewSlice */
27006  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *obj, int writable_flag) {
27007  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27008  __Pyx_BufFmt_StackElem stack[1];
27009  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27010  int retcode;
27011  if (obj == Py_None) {
27012  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27013  return result;
27014  }
27015  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27016  PyBUF_RECORDS_RO | writable_flag, 1,
27017  &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, stack,
27018  &result, obj);
27019  if (unlikely(retcode == -1))
27020  goto __pyx_fail;
27021  return result;
27022 __pyx_fail:
27023  result.memview = NULL;
27024  result.data = NULL;
27025  return result;
27026 }
27027 
27028 /* CIntToPy */
27029  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) {
27030  const npy_int32 neg_one = (npy_int32) ((npy_int32) 0 - (npy_int32) 1), const_zero = (npy_int32) 0;
27031  const int is_unsigned = neg_one > const_zero;
27032  if (is_unsigned) {
27033  if (sizeof(npy_int32) < sizeof(long)) {
27034  return PyInt_FromLong((long) value);
27035  } else if (sizeof(npy_int32) <= sizeof(unsigned long)) {
27036  return PyLong_FromUnsignedLong((unsigned long) value);
27037 #ifdef HAVE_LONG_LONG
27038  } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
27039  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27040 #endif
27041  }
27042  } else {
27043  if (sizeof(npy_int32) <= sizeof(long)) {
27044  return PyInt_FromLong((long) value);
27045 #ifdef HAVE_LONG_LONG
27046  } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
27047  return PyLong_FromLongLong((PY_LONG_LONG) value);
27048 #endif
27049  }
27050  }
27051  {
27052  int one = 1; int little = (int)*(unsigned char *)&one;
27053  unsigned char *bytes = (unsigned char *)&value;
27054  return _PyLong_FromByteArray(bytes, sizeof(npy_int32),
27055  little, !is_unsigned);
27056  }
27057 }
27058 
27059 /* CIntToPy */
27060  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
27061  const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
27062  const int is_unsigned = neg_one > const_zero;
27063  if (is_unsigned) {
27064  if (sizeof(int) < sizeof(long)) {
27065  return PyInt_FromLong((long) value);
27066  } else if (sizeof(int) <= sizeof(unsigned long)) {
27067  return PyLong_FromUnsignedLong((unsigned long) value);
27068 #ifdef HAVE_LONG_LONG
27069  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
27070  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27071 #endif
27072  }
27073  } else {
27074  if (sizeof(int) <= sizeof(long)) {
27075  return PyInt_FromLong((long) value);
27076 #ifdef HAVE_LONG_LONG
27077  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
27078  return PyLong_FromLongLong((PY_LONG_LONG) value);
27079 #endif
27080  }
27081  }
27082  {
27083  int one = 1; int little = (int)*(unsigned char *)&one;
27084  unsigned char *bytes = (unsigned char *)&value;
27085  return _PyLong_FromByteArray(bytes, sizeof(int),
27086  little, !is_unsigned);
27087  }
27088 }
27089 
27090 /* Declarations */
27091  #if CYTHON_CCOMPLEX
27092  #ifdef __cplusplus
27093  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27094  return ::std::complex< float >(x, y);
27095  }
27096  #else
27097  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27098  return x + y*(__pyx_t_float_complex)_Complex_I;
27099  }
27100  #endif
27101 #else
27102  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27103  __pyx_t_float_complex z;
27104  z.real = x;
27105  z.imag = y;
27106  return z;
27107  }
27108 #endif
27109 
27110 /* Arithmetic */
27111  #if CYTHON_CCOMPLEX
27112 #else
27113  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27114  return (a.real == b.real) && (a.imag == b.imag);
27115  }
27116  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27117  __pyx_t_float_complex z;
27118  z.real = a.real + b.real;
27119  z.imag = a.imag + b.imag;
27120  return z;
27121  }
27122  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27123  __pyx_t_float_complex z;
27124  z.real = a.real - b.real;
27125  z.imag = a.imag - b.imag;
27126  return z;
27127  }
27128  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27129  __pyx_t_float_complex z;
27130  z.real = a.real * b.real - a.imag * b.imag;
27131  z.imag = a.real * b.imag + a.imag * b.real;
27132  return z;
27133  }
27134  #if 1
27135  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27136  if (b.imag == 0) {
27137  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27138  } else if (fabsf(b.real) >= fabsf(b.imag)) {
27139  if (b.real == 0 && b.imag == 0) {
27140  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
27141  } else {
27142  float r = b.imag / b.real;
27143  float s = (float)(1.0) / (b.real + b.imag * r);
27144  return __pyx_t_float_complex_from_parts(
27145  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27146  }
27147  } else {
27148  float r = b.real / b.imag;
27149  float s = (float)(1.0) / (b.imag + b.real * r);
27150  return __pyx_t_float_complex_from_parts(
27151  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27152  }
27153  }
27154  #else
27155  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27156  if (b.imag == 0) {
27157  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27158  } else {
27159  float denom = b.real * b.real + b.imag * b.imag;
27160  return __pyx_t_float_complex_from_parts(
27161  (a.real * b.real + a.imag * b.imag) / denom,
27162  (a.imag * b.real - a.real * b.imag) / denom);
27163  }
27164  }
27165  #endif
27166  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
27167  __pyx_t_float_complex z;
27168  z.real = -a.real;
27169  z.imag = -a.imag;
27170  return z;
27171  }
27172  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
27173  return (a.real == 0) && (a.imag == 0);
27174  }
27175  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
27176  __pyx_t_float_complex z;
27177  z.real = a.real;
27178  z.imag = -a.imag;
27179  return z;
27180  }
27181  #if 1
27182  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
27183  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27184  return sqrtf(z.real*z.real + z.imag*z.imag);
27185  #else
27186  return hypotf(z.real, z.imag);
27187  #endif
27188  }
27189  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27190  __pyx_t_float_complex z;
27191  float r, lnr, theta, z_r, z_theta;
27192  if (b.imag == 0 && b.real == (int)b.real) {
27193  if (b.real < 0) {
27194  float denom = a.real * a.real + a.imag * a.imag;
27195  a.real = a.real / denom;
27196  a.imag = -a.imag / denom;
27197  b.real = -b.real;
27198  }
27199  switch ((int)b.real) {
27200  case 0:
27201  z.real = 1;
27202  z.imag = 0;
27203  return z;
27204  case 1:
27205  return a;
27206  case 2:
27207  return __Pyx_c_prod_float(a, a);
27208  case 3:
27209  z = __Pyx_c_prod_float(a, a);
27210  return __Pyx_c_prod_float(z, a);
27211  case 4:
27212  z = __Pyx_c_prod_float(a, a);
27213  return __Pyx_c_prod_float(z, z);
27214  }
27215  }
27216  if (a.imag == 0) {
27217  if (a.real == 0) {
27218  return a;
27219  } else if (b.imag == 0) {
27220  z.real = powf(a.real, b.real);
27221  z.imag = 0;
27222  return z;
27223  } else if (a.real > 0) {
27224  r = a.real;
27225  theta = 0;
27226  } else {
27227  r = -a.real;
27228  theta = atan2f(0.0, -1.0);
27229  }
27230  } else {
27231  r = __Pyx_c_abs_float(a);
27232  theta = atan2f(a.imag, a.real);
27233  }
27234  lnr = logf(r);
27235  z_r = expf(lnr * b.real - theta * b.imag);
27236  z_theta = theta * b.real + lnr * b.imag;
27237  z.real = z_r * cosf(z_theta);
27238  z.imag = z_r * sinf(z_theta);
27239  return z;
27240  }
27241  #endif
27242 #endif
27243 
27244 /* Declarations */
27245  #if CYTHON_CCOMPLEX
27246  #ifdef __cplusplus
27247  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27248  return ::std::complex< double >(x, y);
27249  }
27250  #else
27251  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27252  return x + y*(__pyx_t_double_complex)_Complex_I;
27253  }
27254  #endif
27255 #else
27256  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27257  __pyx_t_double_complex z;
27258  z.real = x;
27259  z.imag = y;
27260  return z;
27261  }
27262 #endif
27263 
27264 /* Arithmetic */
27265  #if CYTHON_CCOMPLEX
27266 #else
27267  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27268  return (a.real == b.real) && (a.imag == b.imag);
27269  }
27270  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27271  __pyx_t_double_complex z;
27272  z.real = a.real + b.real;
27273  z.imag = a.imag + b.imag;
27274  return z;
27275  }
27276  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27277  __pyx_t_double_complex z;
27278  z.real = a.real - b.real;
27279  z.imag = a.imag - b.imag;
27280  return z;
27281  }
27282  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27283  __pyx_t_double_complex z;
27284  z.real = a.real * b.real - a.imag * b.imag;
27285  z.imag = a.real * b.imag + a.imag * b.real;
27286  return z;
27287  }
27288  #if 1
27289  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27290  if (b.imag == 0) {
27291  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27292  } else if (fabs(b.real) >= fabs(b.imag)) {
27293  if (b.real == 0 && b.imag == 0) {
27294  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
27295  } else {
27296  double r = b.imag / b.real;
27297  double s = (double)(1.0) / (b.real + b.imag * r);
27298  return __pyx_t_double_complex_from_parts(
27299  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27300  }
27301  } else {
27302  double r = b.real / b.imag;
27303  double s = (double)(1.0) / (b.imag + b.real * r);
27304  return __pyx_t_double_complex_from_parts(
27305  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27306  }
27307  }
27308  #else
27309  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27310  if (b.imag == 0) {
27311  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27312  } else {
27313  double denom = b.real * b.real + b.imag * b.imag;
27314  return __pyx_t_double_complex_from_parts(
27315  (a.real * b.real + a.imag * b.imag) / denom,
27316  (a.imag * b.real - a.real * b.imag) / denom);
27317  }
27318  }
27319  #endif
27320  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
27321  __pyx_t_double_complex z;
27322  z.real = -a.real;
27323  z.imag = -a.imag;
27324  return z;
27325  }
27326  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
27327  return (a.real == 0) && (a.imag == 0);
27328  }
27329  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
27330  __pyx_t_double_complex z;
27331  z.real = a.real;
27332  z.imag = -a.imag;
27333  return z;
27334  }
27335  #if 1
27336  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
27337  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27338  return sqrt(z.real*z.real + z.imag*z.imag);
27339  #else
27340  return hypot(z.real, z.imag);
27341  #endif
27342  }
27343  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27344  __pyx_t_double_complex z;
27345  double r, lnr, theta, z_r, z_theta;
27346  if (b.imag == 0 && b.real == (int)b.real) {
27347  if (b.real < 0) {
27348  double denom = a.real * a.real + a.imag * a.imag;
27349  a.real = a.real / denom;
27350  a.imag = -a.imag / denom;
27351  b.real = -b.real;
27352  }
27353  switch ((int)b.real) {
27354  case 0:
27355  z.real = 1;
27356  z.imag = 0;
27357  return z;
27358  case 1:
27359  return a;
27360  case 2:
27361  return __Pyx_c_prod_double(a, a);
27362  case 3:
27363  z = __Pyx_c_prod_double(a, a);
27364  return __Pyx_c_prod_double(z, a);
27365  case 4:
27366  z = __Pyx_c_prod_double(a, a);
27367  return __Pyx_c_prod_double(z, z);
27368  }
27369  }
27370  if (a.imag == 0) {
27371  if (a.real == 0) {
27372  return a;
27373  } else if (b.imag == 0) {
27374  z.real = pow(a.real, b.real);
27375  z.imag = 0;
27376  return z;
27377  } else if (a.real > 0) {
27378  r = a.real;
27379  theta = 0;
27380  } else {
27381  r = -a.real;
27382  theta = atan2(0.0, -1.0);
27383  }
27384  } else {
27385  r = __Pyx_c_abs_double(a);
27386  theta = atan2(a.imag, a.real);
27387  }
27388  lnr = log(r);
27389  z_r = exp(lnr * b.real - theta * b.imag);
27390  z_theta = theta * b.real + lnr * b.imag;
27391  z.real = z_r * cos(z_theta);
27392  z.imag = z_r * sin(z_theta);
27393  return z;
27394  }
27395  #endif
27396 #endif
27397 
27398 /* CIntToPy */
27399  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
27400  const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
27401  const int is_unsigned = neg_one > const_zero;
27402  if (is_unsigned) {
27403  if (sizeof(enum NPY_TYPES) < sizeof(long)) {
27404  return PyInt_FromLong((long) value);
27405  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
27406  return PyLong_FromUnsignedLong((unsigned long) value);
27407 #ifdef HAVE_LONG_LONG
27408  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
27409  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27410 #endif
27411  }
27412  } else {
27413  if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
27414  return PyInt_FromLong((long) value);
27415 #ifdef HAVE_LONG_LONG
27416  } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
27417  return PyLong_FromLongLong((PY_LONG_LONG) value);
27418 #endif
27419  }
27420  }
27421  {
27422  int one = 1; int little = (int)*(unsigned char *)&one;
27423  unsigned char *bytes = (unsigned char *)&value;
27424  return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
27425  little, !is_unsigned);
27426  }
27427 }
27428 
27429 /* MemviewSliceCopyTemplate */
27430  static __Pyx_memviewslice
27431 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
27432  const char *mode, int ndim,
27433  size_t sizeof_dtype, int contig_flag,
27434  int dtype_is_object)
27435 {
27436  __Pyx_RefNannyDeclarations
27437  int i;
27438  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
27439  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
27440  Py_buffer *buf = &from_memview->view;
27441  PyObject *shape_tuple = NULL;
27442  PyObject *temp_int = NULL;
27443  struct __pyx_array_obj *array_obj = NULL;
27444  struct __pyx_memoryview_obj *memview_obj = NULL;
27445  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
27446  for (i = 0; i < ndim; i++) {
27447  if (unlikely(from_mvs->suboffsets[i] >= 0)) {
27448  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
27449  "indirect dimensions (axis %d)", i);
27450  goto fail;
27451  }
27452  }
27453  shape_tuple = PyTuple_New(ndim);
27454  if (unlikely(!shape_tuple)) {
27455  goto fail;
27456  }
27457  __Pyx_GOTREF(shape_tuple);
27458  for(i = 0; i < ndim; i++) {
27459  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
27460  if(unlikely(!temp_int)) {
27461  goto fail;
27462  } else {
27463  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
27464  temp_int = NULL;
27465  }
27466  }
27467  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
27468  if (unlikely(!array_obj)) {
27469  goto fail;
27470  }
27471  __Pyx_GOTREF(array_obj);
27472  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27473  (PyObject *) array_obj, contig_flag,
27474  dtype_is_object,
27475  from_mvs->memview->typeinfo);
27476  if (unlikely(!memview_obj))
27477  goto fail;
27478  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
27479  goto fail;
27480  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
27481  dtype_is_object) < 0))
27482  goto fail;
27483  goto no_fail;
27484 fail:
27485  __Pyx_XDECREF(new_mvs.memview);
27486  new_mvs.memview = NULL;
27487  new_mvs.data = NULL;
27488 no_fail:
27489  __Pyx_XDECREF(shape_tuple);
27490  __Pyx_XDECREF(temp_int);
27491  __Pyx_XDECREF(array_obj);
27492  __Pyx_RefNannyFinishContext();
27493  return new_mvs;
27494 }
27495 
27496 /* CIntFromPy */
27497  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
27498  const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
27499  const int is_unsigned = neg_one > const_zero;
27500 #if PY_MAJOR_VERSION < 3
27501  if (likely(PyInt_Check(x))) {
27502  if (sizeof(int) < sizeof(long)) {
27503  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
27504  } else {
27505  long val = PyInt_AS_LONG(x);
27506  if (is_unsigned && unlikely(val < 0)) {
27507  goto raise_neg_overflow;
27508  }
27509  return (int) val;
27510  }
27511  } else
27512 #endif
27513  if (likely(PyLong_Check(x))) {
27514  if (is_unsigned) {
27515 #if CYTHON_USE_PYLONG_INTERNALS
27516  const digit* digits = ((PyLongObject*)x)->ob_digit;
27517  switch (Py_SIZE(x)) {
27518  case 0: return (int) 0;
27519  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
27520  case 2:
27521  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
27522  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27523  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27524  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
27525  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27526  }
27527  }
27528  break;
27529  case 3:
27530  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
27531  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27532  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27533  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
27534  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27535  }
27536  }
27537  break;
27538  case 4:
27539  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
27540  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27541  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27542  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
27543  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27544  }
27545  }
27546  break;
27547  }
27548 #endif
27549 #if CYTHON_COMPILING_IN_CPYTHON
27550  if (unlikely(Py_SIZE(x) < 0)) {
27551  goto raise_neg_overflow;
27552  }
27553 #else
27554  {
27555  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27556  if (unlikely(result < 0))
27557  return (int) -1;
27558  if (unlikely(result == 1))
27559  goto raise_neg_overflow;
27560  }
27561 #endif
27562  if (sizeof(int) <= sizeof(unsigned long)) {
27563  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
27564 #ifdef HAVE_LONG_LONG
27565  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
27566  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27567 #endif
27568  }
27569  } else {
27570 #if CYTHON_USE_PYLONG_INTERNALS
27571  const digit* digits = ((PyLongObject*)x)->ob_digit;
27572  switch (Py_SIZE(x)) {
27573  case 0: return (int) 0;
27574  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
27575  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
27576  case -2:
27577  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
27578  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27579  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27580  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27581  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27582  }
27583  }
27584  break;
27585  case 2:
27586  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
27587  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27588  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27589  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27590  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27591  }
27592  }
27593  break;
27594  case -3:
27595  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27596  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27597  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27598  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
27599  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27600  }
27601  }
27602  break;
27603  case 3:
27604  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
27605  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27606  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27607  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
27608  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27609  }
27610  }
27611  break;
27612  case -4:
27613  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
27614  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27615  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27616  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
27617  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27618  }
27619  }
27620  break;
27621  case 4:
27622  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
27623  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27624  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27625  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
27626  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27627  }
27628  }
27629  break;
27630  }
27631 #endif
27632  if (sizeof(int) <= sizeof(long)) {
27633  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
27634 #ifdef HAVE_LONG_LONG
27635  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
27636  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
27637 #endif
27638  }
27639  }
27640  {
27641 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27642  PyErr_SetString(PyExc_RuntimeError,
27643  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27644 #else
27645  int val;
27646  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27647  #if PY_MAJOR_VERSION < 3
27648  if (likely(v) && !PyLong_Check(v)) {
27649  PyObject *tmp = v;
27650  v = PyNumber_Long(tmp);
27651  Py_DECREF(tmp);
27652  }
27653  #endif
27654  if (likely(v)) {
27655  int one = 1; int is_little = (int)*(unsigned char *)&one;
27656  unsigned char *bytes = (unsigned char *)&val;
27657  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27658  bytes, sizeof(val),
27659  is_little, !is_unsigned);
27660  Py_DECREF(v);
27661  if (likely(!ret))
27662  return val;
27663  }
27664 #endif
27665  return (int) -1;
27666  }
27667  } else {
27668  int val;
27669  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27670  if (!tmp) return (int) -1;
27671  val = __Pyx_PyInt_As_int(tmp);
27672  Py_DECREF(tmp);
27673  return val;
27674  }
27675 raise_overflow:
27676  PyErr_SetString(PyExc_OverflowError,
27677  "value too large to convert to int");
27678  return (int) -1;
27679 raise_neg_overflow:
27680  PyErr_SetString(PyExc_OverflowError,
27681  "can't convert negative value to int");
27682  return (int) -1;
27683 }
27684 
27685 /* CIntFromPy */
27686  static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) {
27687  const npy_int32 neg_one = (npy_int32) ((npy_int32) 0 - (npy_int32) 1), const_zero = (npy_int32) 0;
27688  const int is_unsigned = neg_one > const_zero;
27689 #if PY_MAJOR_VERSION < 3
27690  if (likely(PyInt_Check(x))) {
27691  if (sizeof(npy_int32) < sizeof(long)) {
27692  __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG(x))
27693  } else {
27694  long val = PyInt_AS_LONG(x);
27695  if (is_unsigned && unlikely(val < 0)) {
27696  goto raise_neg_overflow;
27697  }
27698  return (npy_int32) val;
27699  }
27700  } else
27701 #endif
27702  if (likely(PyLong_Check(x))) {
27703  if (is_unsigned) {
27704 #if CYTHON_USE_PYLONG_INTERNALS
27705  const digit* digits = ((PyLongObject*)x)->ob_digit;
27706  switch (Py_SIZE(x)) {
27707  case 0: return (npy_int32) 0;
27708  case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, digits[0])
27709  case 2:
27710  if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
27711  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27712  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27713  } else if (8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT) {
27714  return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
27715  }
27716  }
27717  break;
27718  case 3:
27719  if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
27720  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27721  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27722  } else if (8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT) {
27723  return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
27724  }
27725  }
27726  break;
27727  case 4:
27728  if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
27729  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27730  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27731  } else if (8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT) {
27732  return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
27733  }
27734  }
27735  break;
27736  }
27737 #endif
27738 #if CYTHON_COMPILING_IN_CPYTHON
27739  if (unlikely(Py_SIZE(x) < 0)) {
27740  goto raise_neg_overflow;
27741  }
27742 #else
27743  {
27744  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27745  if (unlikely(result < 0))
27746  return (npy_int32) -1;
27747  if (unlikely(result == 1))
27748  goto raise_neg_overflow;
27749  }
27750 #endif
27751  if (sizeof(npy_int32) <= sizeof(unsigned long)) {
27752  __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x))
27753 #ifdef HAVE_LONG_LONG
27754  } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
27755  __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27756 #endif
27757  }
27758  } else {
27759 #if CYTHON_USE_PYLONG_INTERNALS
27760  const digit* digits = ((PyLongObject*)x)->ob_digit;
27761  switch (Py_SIZE(x)) {
27762  case 0: return (npy_int32) 0;
27763  case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, (sdigit) (-(sdigit)digits[0]))
27764  case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, +digits[0])
27765  case -2:
27766  if (8 * sizeof(npy_int32) - 1 > 1 * PyLong_SHIFT) {
27767  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27768  __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27769  } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
27770  return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
27771  }
27772  }
27773  break;
27774  case 2:
27775  if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
27776  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27777  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27778  } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
27779  return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
27780  }
27781  }
27782  break;
27783  case -3:
27784  if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
27785  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27786  __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27787  } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
27788  return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
27789  }
27790  }
27791  break;
27792  case 3:
27793  if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
27794  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27795  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27796  } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
27797  return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
27798  }
27799  }
27800  break;
27801  case -4:
27802  if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
27803  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27804  __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27805  } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
27806  return (npy_int32) (((npy_int32)-1)*(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
27807  }
27808  }
27809  break;
27810  case 4:
27811  if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
27812  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27813  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27814  } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
27815  return (npy_int32) ((((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
27816  }
27817  }
27818  break;
27819  }
27820 #endif
27821  if (sizeof(npy_int32) <= sizeof(long)) {
27822  __PYX_VERIFY_RETURN_INT_EXC(npy_int32, long, PyLong_AsLong(x))
27823 #ifdef HAVE_LONG_LONG
27824  } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
27825  __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x))
27826 #endif
27827  }
27828  }
27829  {
27830 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27831  PyErr_SetString(PyExc_RuntimeError,
27832  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27833 #else
27834  npy_int32 val;
27835  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27836  #if PY_MAJOR_VERSION < 3
27837  if (likely(v) && !PyLong_Check(v)) {
27838  PyObject *tmp = v;
27839  v = PyNumber_Long(tmp);
27840  Py_DECREF(tmp);
27841  }
27842  #endif
27843  if (likely(v)) {
27844  int one = 1; int is_little = (int)*(unsigned char *)&one;
27845  unsigned char *bytes = (unsigned char *)&val;
27846  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27847  bytes, sizeof(val),
27848  is_little, !is_unsigned);
27849  Py_DECREF(v);
27850  if (likely(!ret))
27851  return val;
27852  }
27853 #endif
27854  return (npy_int32) -1;
27855  }
27856  } else {
27857  npy_int32 val;
27858  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27859  if (!tmp) return (npy_int32) -1;
27860  val = __Pyx_PyInt_As_npy_int32(tmp);
27861  Py_DECREF(tmp);
27862  return val;
27863  }
27864 raise_overflow:
27865  PyErr_SetString(PyExc_OverflowError,
27866  "value too large to convert to npy_int32");
27867  return (npy_int32) -1;
27868 raise_neg_overflow:
27869  PyErr_SetString(PyExc_OverflowError,
27870  "can't convert negative value to npy_int32");
27871  return (npy_int32) -1;
27872 }
27873 
27874 /* CIntFromPy */
27875  static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
27876  const size_t neg_one = (size_t) ((size_t) 0 - (size_t) 1), const_zero = (size_t) 0;
27877  const int is_unsigned = neg_one > const_zero;
27878 #if PY_MAJOR_VERSION < 3
27879  if (likely(PyInt_Check(x))) {
27880  if (sizeof(size_t) < sizeof(long)) {
27881  __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
27882  } else {
27883  long val = PyInt_AS_LONG(x);
27884  if (is_unsigned && unlikely(val < 0)) {
27885  goto raise_neg_overflow;
27886  }
27887  return (size_t) val;
27888  }
27889  } else
27890 #endif
27891  if (likely(PyLong_Check(x))) {
27892  if (is_unsigned) {
27893 #if CYTHON_USE_PYLONG_INTERNALS
27894  const digit* digits = ((PyLongObject*)x)->ob_digit;
27895  switch (Py_SIZE(x)) {
27896  case 0: return (size_t) 0;
27897  case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
27898  case 2:
27899  if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
27900  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27901  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27902  } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
27903  return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27904  }
27905  }
27906  break;
27907  case 3:
27908  if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
27909  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27910  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27911  } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
27912  return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27913  }
27914  }
27915  break;
27916  case 4:
27917  if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
27918  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27919  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27920  } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
27921  return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27922  }
27923  }
27924  break;
27925  }
27926 #endif
27927 #if CYTHON_COMPILING_IN_CPYTHON
27928  if (unlikely(Py_SIZE(x) < 0)) {
27929  goto raise_neg_overflow;
27930  }
27931 #else
27932  {
27933  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27934  if (unlikely(result < 0))
27935  return (size_t) -1;
27936  if (unlikely(result == 1))
27937  goto raise_neg_overflow;
27938  }
27939 #endif
27940  if (sizeof(size_t) <= sizeof(unsigned long)) {
27941  __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
27942 #ifdef HAVE_LONG_LONG
27943  } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
27944  __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27945 #endif
27946  }
27947  } else {
27948 #if CYTHON_USE_PYLONG_INTERNALS
27949  const digit* digits = ((PyLongObject*)x)->ob_digit;
27950  switch (Py_SIZE(x)) {
27951  case 0: return (size_t) 0;
27952  case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
27953  case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0])
27954  case -2:
27955  if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
27956  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27957  __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27958  } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
27959  return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
27960  }
27961  }
27962  break;
27963  case 2:
27964  if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
27965  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27966  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27967  } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
27968  return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
27969  }
27970  }
27971  break;
27972  case -3:
27973  if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
27974  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27975  __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27976  } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
27977  return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
27978  }
27979  }
27980  break;
27981  case 3:
27982  if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
27983  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27984  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27985  } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
27986  return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
27987  }
27988  }
27989  break;
27990  case -4:
27991  if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
27992  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27993  __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27994  } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
27995  return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
27996  }
27997  }
27998  break;
27999  case 4:
28000  if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
28001  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28002  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28003  } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
28004  return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
28005  }
28006  }
28007  break;
28008  }
28009 #endif
28010  if (sizeof(size_t) <= sizeof(long)) {
28011  __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
28012 #ifdef HAVE_LONG_LONG
28013  } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
28014  __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
28015 #endif
28016  }
28017  }
28018  {
28019 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28020  PyErr_SetString(PyExc_RuntimeError,
28021  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28022 #else
28023  size_t val;
28024  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28025  #if PY_MAJOR_VERSION < 3
28026  if (likely(v) && !PyLong_Check(v)) {
28027  PyObject *tmp = v;
28028  v = PyNumber_Long(tmp);
28029  Py_DECREF(tmp);
28030  }
28031  #endif
28032  if (likely(v)) {
28033  int one = 1; int is_little = (int)*(unsigned char *)&one;
28034  unsigned char *bytes = (unsigned char *)&val;
28035  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28036  bytes, sizeof(val),
28037  is_little, !is_unsigned);
28038  Py_DECREF(v);
28039  if (likely(!ret))
28040  return val;
28041  }
28042 #endif
28043  return (size_t) -1;
28044  }
28045  } else {
28046  size_t val;
28047  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28048  if (!tmp) return (size_t) -1;
28049  val = __Pyx_PyInt_As_size_t(tmp);
28050  Py_DECREF(tmp);
28051  return val;
28052  }
28053 raise_overflow:
28054  PyErr_SetString(PyExc_OverflowError,
28055  "value too large to convert to size_t");
28056  return (size_t) -1;
28057 raise_neg_overflow:
28058  PyErr_SetString(PyExc_OverflowError,
28059  "can't convert negative value to size_t");
28060  return (size_t) -1;
28061 }
28062 
28063 /* CIntFromPy */
28064  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
28065  const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
28066  const int is_unsigned = neg_one > const_zero;
28067 #if PY_MAJOR_VERSION < 3
28068  if (likely(PyInt_Check(x))) {
28069  if (sizeof(long) < sizeof(long)) {
28070  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
28071  } else {
28072  long val = PyInt_AS_LONG(x);
28073  if (is_unsigned && unlikely(val < 0)) {
28074  goto raise_neg_overflow;
28075  }
28076  return (long) val;
28077  }
28078  } else
28079 #endif
28080  if (likely(PyLong_Check(x))) {
28081  if (is_unsigned) {
28082 #if CYTHON_USE_PYLONG_INTERNALS
28083  const digit* digits = ((PyLongObject*)x)->ob_digit;
28084  switch (Py_SIZE(x)) {
28085  case 0: return (long) 0;
28086  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
28087  case 2:
28088  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28089  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28090  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28091  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
28092  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28093  }
28094  }
28095  break;
28096  case 3:
28097  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28098  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28099  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28100  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
28101  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28102  }
28103  }
28104  break;
28105  case 4:
28106  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28107  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28108  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28109  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
28110  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28111  }
28112  }
28113  break;
28114  }
28115 #endif
28116 #if CYTHON_COMPILING_IN_CPYTHON
28117  if (unlikely(Py_SIZE(x) < 0)) {
28118  goto raise_neg_overflow;
28119  }
28120 #else
28121  {
28122  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28123  if (unlikely(result < 0))
28124  return (long) -1;
28125  if (unlikely(result == 1))
28126  goto raise_neg_overflow;
28127  }
28128 #endif
28129  if (sizeof(long) <= sizeof(unsigned long)) {
28130  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
28131 #ifdef HAVE_LONG_LONG
28132  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28133  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28134 #endif
28135  }
28136  } else {
28137 #if CYTHON_USE_PYLONG_INTERNALS
28138  const digit* digits = ((PyLongObject*)x)->ob_digit;
28139  switch (Py_SIZE(x)) {
28140  case 0: return (long) 0;
28141  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
28142  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
28143  case -2:
28144  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
28145  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28146  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28147  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28148  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28149  }
28150  }
28151  break;
28152  case 2:
28153  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28154  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28155  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28156  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28157  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28158  }
28159  }
28160  break;
28161  case -3:
28162  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28163  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28164  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28165  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28166  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28167  }
28168  }
28169  break;
28170  case 3:
28171  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28172  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28173  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28174  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28175  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28176  }
28177  }
28178  break;
28179  case -4:
28180  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28181  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28182  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28183  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28184  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28185  }
28186  }
28187  break;
28188  case 4:
28189  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28190  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28191  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28192  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28193  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28194  }
28195  }
28196  break;
28197  }
28198 #endif
28199  if (sizeof(long) <= sizeof(long)) {
28200  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
28201 #ifdef HAVE_LONG_LONG
28202  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28203  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
28204 #endif
28205  }
28206  }
28207  {
28208 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28209  PyErr_SetString(PyExc_RuntimeError,
28210  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28211 #else
28212  long val;
28213  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28214  #if PY_MAJOR_VERSION < 3
28215  if (likely(v) && !PyLong_Check(v)) {
28216  PyObject *tmp = v;
28217  v = PyNumber_Long(tmp);
28218  Py_DECREF(tmp);
28219  }
28220  #endif
28221  if (likely(v)) {
28222  int one = 1; int is_little = (int)*(unsigned char *)&one;
28223  unsigned char *bytes = (unsigned char *)&val;
28224  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28225  bytes, sizeof(val),
28226  is_little, !is_unsigned);
28227  Py_DECREF(v);
28228  if (likely(!ret))
28229  return val;
28230  }
28231 #endif
28232  return (long) -1;
28233  }
28234  } else {
28235  long val;
28236  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28237  if (!tmp) return (long) -1;
28238  val = __Pyx_PyInt_As_long(tmp);
28239  Py_DECREF(tmp);
28240  return val;
28241  }
28242 raise_overflow:
28243  PyErr_SetString(PyExc_OverflowError,
28244  "value too large to convert to long");
28245  return (long) -1;
28246 raise_neg_overflow:
28247  PyErr_SetString(PyExc_OverflowError,
28248  "can't convert negative value to long");
28249  return (long) -1;
28250 }
28251 
28252 /* CIntToPy */
28253  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
28254  const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
28255  const int is_unsigned = neg_one > const_zero;
28256  if (is_unsigned) {
28257  if (sizeof(long) < sizeof(long)) {
28258  return PyInt_FromLong((long) value);
28259  } else if (sizeof(long) <= sizeof(unsigned long)) {
28260  return PyLong_FromUnsignedLong((unsigned long) value);
28261 #ifdef HAVE_LONG_LONG
28262  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28263  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28264 #endif
28265  }
28266  } else {
28267  if (sizeof(long) <= sizeof(long)) {
28268  return PyInt_FromLong((long) value);
28269 #ifdef HAVE_LONG_LONG
28270  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28271  return PyLong_FromLongLong((PY_LONG_LONG) value);
28272 #endif
28273  }
28274  }
28275  {
28276  int one = 1; int little = (int)*(unsigned char *)&one;
28277  unsigned char *bytes = (unsigned char *)&value;
28278  return _PyLong_FromByteArray(bytes, sizeof(long),
28279  little, !is_unsigned);
28280  }
28281 }
28282 
28283 /* CIntFromPy */
28284  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
28285  const char neg_one = (char) ((char) 0 - (char) 1), const_zero = (char) 0;
28286  const int is_unsigned = neg_one > const_zero;
28287 #if PY_MAJOR_VERSION < 3
28288  if (likely(PyInt_Check(x))) {
28289  if (sizeof(char) < sizeof(long)) {
28290  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
28291  } else {
28292  long val = PyInt_AS_LONG(x);
28293  if (is_unsigned && unlikely(val < 0)) {
28294  goto raise_neg_overflow;
28295  }
28296  return (char) val;
28297  }
28298  } else
28299 #endif
28300  if (likely(PyLong_Check(x))) {
28301  if (is_unsigned) {
28302 #if CYTHON_USE_PYLONG_INTERNALS
28303  const digit* digits = ((PyLongObject*)x)->ob_digit;
28304  switch (Py_SIZE(x)) {
28305  case 0: return (char) 0;
28306  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
28307  case 2:
28308  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28309  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28310  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28311  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
28312  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28313  }
28314  }
28315  break;
28316  case 3:
28317  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28318  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28319  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28320  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
28321  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28322  }
28323  }
28324  break;
28325  case 4:
28326  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28327  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28328  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28329  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
28330  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28331  }
28332  }
28333  break;
28334  }
28335 #endif
28336 #if CYTHON_COMPILING_IN_CPYTHON
28337  if (unlikely(Py_SIZE(x) < 0)) {
28338  goto raise_neg_overflow;
28339  }
28340 #else
28341  {
28342  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28343  if (unlikely(result < 0))
28344  return (char) -1;
28345  if (unlikely(result == 1))
28346  goto raise_neg_overflow;
28347  }
28348 #endif
28349  if (sizeof(char) <= sizeof(unsigned long)) {
28350  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
28351 #ifdef HAVE_LONG_LONG
28352  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
28353  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28354 #endif
28355  }
28356  } else {
28357 #if CYTHON_USE_PYLONG_INTERNALS
28358  const digit* digits = ((PyLongObject*)x)->ob_digit;
28359  switch (Py_SIZE(x)) {
28360  case 0: return (char) 0;
28361  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
28362  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
28363  case -2:
28364  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
28365  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28366  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28367  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28368  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28369  }
28370  }
28371  break;
28372  case 2:
28373  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28374  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28375  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28376  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28377  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28378  }
28379  }
28380  break;
28381  case -3:
28382  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28383  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28384  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28385  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28386  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28387  }
28388  }
28389  break;
28390  case 3:
28391  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28392  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28393  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28394  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28395  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28396  }
28397  }
28398  break;
28399  case -4:
28400  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28401  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28402  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28403  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28404  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28405  }
28406  }
28407  break;
28408  case 4:
28409  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28410  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28411  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28412  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28413  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28414  }
28415  }
28416  break;
28417  }
28418 #endif
28419  if (sizeof(char) <= sizeof(long)) {
28420  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
28421 #ifdef HAVE_LONG_LONG
28422  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
28423  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
28424 #endif
28425  }
28426  }
28427  {
28428 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28429  PyErr_SetString(PyExc_RuntimeError,
28430  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28431 #else
28432  char val;
28433  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28434  #if PY_MAJOR_VERSION < 3
28435  if (likely(v) && !PyLong_Check(v)) {
28436  PyObject *tmp = v;
28437  v = PyNumber_Long(tmp);
28438  Py_DECREF(tmp);
28439  }
28440  #endif
28441  if (likely(v)) {
28442  int one = 1; int is_little = (int)*(unsigned char *)&one;
28443  unsigned char *bytes = (unsigned char *)&val;
28444  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28445  bytes, sizeof(val),
28446  is_little, !is_unsigned);
28447  Py_DECREF(v);
28448  if (likely(!ret))
28449  return val;
28450  }
28451 #endif
28452  return (char) -1;
28453  }
28454  } else {
28455  char val;
28456  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28457  if (!tmp) return (char) -1;
28458  val = __Pyx_PyInt_As_char(tmp);
28459  Py_DECREF(tmp);
28460  return val;
28461  }
28462 raise_overflow:
28463  PyErr_SetString(PyExc_OverflowError,
28464  "value too large to convert to char");
28465  return (char) -1;
28466 raise_neg_overflow:
28467  PyErr_SetString(PyExc_OverflowError,
28468  "can't convert negative value to char");
28469  return (char) -1;
28470 }
28471 
28472 /* CheckBinaryVersion */
28473  static int __Pyx_check_binary_version(void) {
28474  char ctversion[4], rtversion[4];
28475  PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
28476  PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
28477  if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
28478  char message[200];
28479  PyOS_snprintf(message, sizeof(message),
28480  "compiletime version %s of module '%.100s' "
28481  "does not match runtime version %s",
28482  ctversion, __Pyx_MODULE_NAME, rtversion);
28483  return PyErr_WarnEx(NULL, message, 1);
28484  }
28485  return 0;
28486 }
28487 
28488 /* InitStrings */
28489  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
28490  while (t->p) {
28491  #if PY_MAJOR_VERSION < 3
28492  if (t->is_unicode) {
28493  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
28494  } else if (t->intern) {
28495  *t->p = PyString_InternFromString(t->s);
28496  } else {
28497  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
28498  }
28499  #else
28500  if (t->is_unicode | t->is_str) {
28501  if (t->intern) {
28502  *t->p = PyUnicode_InternFromString(t->s);
28503  } else if (t->encoding) {
28504  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
28505  } else {
28506  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
28507  }
28508  } else {
28509  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
28510  }
28511  #endif
28512  if (!*t->p)
28513  return -1;
28514  if (PyObject_Hash(*t->p) == -1)
28515  return -1;
28516  ++t;
28517  }
28518  return 0;
28519 }
28520 
28521 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
28522  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
28523 }
28524 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
28525  Py_ssize_t ignore;
28526  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
28527 }
28528 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28529 #if !CYTHON_PEP393_ENABLED
28530 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28531  char* defenc_c;
28532  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
28533  if (!defenc) return NULL;
28534  defenc_c = PyBytes_AS_STRING(defenc);
28535 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28536  {
28537  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
28538  char* c;
28539  for (c = defenc_c; c < end; c++) {
28540  if ((unsigned char) (*c) >= 128) {
28541  PyUnicode_AsASCIIString(o);
28542  return NULL;
28543  }
28544  }
28545  }
28546 #endif
28547  *length = PyBytes_GET_SIZE(defenc);
28548  return defenc_c;
28549 }
28550 #else
28551 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28552  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
28553 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28554  if (likely(PyUnicode_IS_ASCII(o))) {
28555  *length = PyUnicode_GET_LENGTH(o);
28556  return PyUnicode_AsUTF8(o);
28557  } else {
28558  PyUnicode_AsASCIIString(o);
28559  return NULL;
28560  }
28561 #else
28562  return PyUnicode_AsUTF8AndSize(o, length);
28563 #endif
28564 }
28565 #endif
28566 #endif
28567 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28568 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28569  if (
28570 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28571  __Pyx_sys_getdefaultencoding_not_ascii &&
28572 #endif
28573  PyUnicode_Check(o)) {
28574  return __Pyx_PyUnicode_AsStringAndSize(o, length);
28575  } else
28576 #endif
28577 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
28578  if (PyByteArray_Check(o)) {
28579  *length = PyByteArray_GET_SIZE(o);
28580  return PyByteArray_AS_STRING(o);
28581  } else
28582 #endif
28583  {
28584  char* result;
28585  int r = PyBytes_AsStringAndSize(o, &result, length);
28586  if (unlikely(r < 0)) {
28587  return NULL;
28588  } else {
28589  return result;
28590  }
28591  }
28592 }
28593 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
28594  int is_true = x == Py_True;
28595  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
28596  else return PyObject_IsTrue(x);
28597 }
28598 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
28599  int retval;
28600  if (unlikely(!x)) return -1;
28601  retval = __Pyx_PyObject_IsTrue(x);
28602  Py_DECREF(x);
28603  return retval;
28604 }
28605 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
28606 #if PY_MAJOR_VERSION >= 3
28607  if (PyLong_Check(result)) {
28608  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
28609  "__int__ returned non-int (type %.200s). "
28610  "The ability to return an instance of a strict subclass of int "
28611  "is deprecated, and may be removed in a future version of Python.",
28612  Py_TYPE(result)->tp_name)) {
28613  Py_DECREF(result);
28614  return NULL;
28615  }
28616  return result;
28617  }
28618 #endif
28619  PyErr_Format(PyExc_TypeError,
28620  "__%.4s__ returned non-%.4s (type %.200s)",
28621  type_name, type_name, Py_TYPE(result)->tp_name);
28622  Py_DECREF(result);
28623  return NULL;
28624 }
28625 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
28626 #if CYTHON_USE_TYPE_SLOTS
28627  PyNumberMethods *m;
28628 #endif
28629  const char *name = NULL;
28630  PyObject *res = NULL;
28631 #if PY_MAJOR_VERSION < 3
28632  if (likely(PyInt_Check(x) || PyLong_Check(x)))
28633 #else
28634  if (likely(PyLong_Check(x)))
28635 #endif
28636  return __Pyx_NewRef(x);
28637 #if CYTHON_USE_TYPE_SLOTS
28638  m = Py_TYPE(x)->tp_as_number;
28639  #if PY_MAJOR_VERSION < 3
28640  if (m && m->nb_int) {
28641  name = "int";
28642  res = m->nb_int(x);
28643  }
28644  else if (m && m->nb_long) {
28645  name = "long";
28646  res = m->nb_long(x);
28647  }
28648  #else
28649  if (likely(m && m->nb_int)) {
28650  name = "int";
28651  res = m->nb_int(x);
28652  }
28653  #endif
28654 #else
28655  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
28656  res = PyNumber_Int(x);
28657  }
28658 #endif
28659  if (likely(res)) {
28660 #if PY_MAJOR_VERSION < 3
28661  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
28662 #else
28663  if (unlikely(!PyLong_CheckExact(res))) {
28664 #endif
28665  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
28666  }
28667  }
28668  else if (!PyErr_Occurred()) {
28669  PyErr_SetString(PyExc_TypeError,
28670  "an integer is required");
28671  }
28672  return res;
28673 }
28674 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
28675  Py_ssize_t ival;
28676  PyObject *x;
28677 #if PY_MAJOR_VERSION < 3
28678  if (likely(PyInt_CheckExact(b))) {
28679  if (sizeof(Py_ssize_t) >= sizeof(long))
28680  return PyInt_AS_LONG(b);
28681  else
28682  return PyInt_AsSsize_t(b);
28683  }
28684 #endif
28685  if (likely(PyLong_CheckExact(b))) {
28686  #if CYTHON_USE_PYLONG_INTERNALS
28687  const digit* digits = ((PyLongObject*)b)->ob_digit;
28688  const Py_ssize_t size = Py_SIZE(b);
28689  if (likely(__Pyx_sst_abs(size) <= 1)) {
28690  ival = likely(size) ? digits[0] : 0;
28691  if (size == -1) ival = -ival;
28692  return ival;
28693  } else {
28694  switch (size) {
28695  case 2:
28696  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28697  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28698  }
28699  break;
28700  case -2:
28701  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28702  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28703  }
28704  break;
28705  case 3:
28706  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28707  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28708  }
28709  break;
28710  case -3:
28711  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28712  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28713  }
28714  break;
28715  case 4:
28716  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28717  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28718  }
28719  break;
28720  case -4:
28721  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28722  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28723  }
28724  break;
28725  }
28726  }
28727  #endif
28728  return PyLong_AsSsize_t(b);
28729  }
28730  x = PyNumber_Index(b);
28731  if (!x) return -1;
28732  ival = PyInt_AsSsize_t(x);
28733  Py_DECREF(x);
28734  return ival;
28735 }
28736 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
28737  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
28738 }
28739 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
28740  return PyInt_FromSize_t(ival);
28741 }
28742 
28743 
28744 #endif /* Py_PYTHON_H */
f
Double f
Definition: Headers.h:64
number
Int number
Definition: Headers.h:33
s
Double s
Definition: Headers.h:84
L
Double L
Definition: Headers.h:72
n
Int n
Definition: Headers.h:28
q
Double q
Definition: Headers.h:81
U
Double U
Definition: Headers.h:88
v
Double v
Definition: Headers.h:95
T
Double T
Definition: Headers.h:87
z
Double * z
Definition: Headers.h:49
u
Double u
Definition: Headers.h:89
ns
Int ns
Definition: Headers.h:30
c
Double c
Definition: Headers.h:54
proteus_superlu.h
r
Double r
Definition: Headers.h:83
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8
nnz
#define nnz
Definition: Richards.h:8